Click here to Skip to main content
15,910,603 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Knowing Client Window Messages in MDI Window ... Pin
Mike Upton12-Jul-02 3:52
Mike Upton12-Jul-02 3:52 
GeneralNice :))))) ... Thanks Pin
Cursoe12-Jul-02 17:14
sussCursoe12-Jul-02 17:14 
Generalto Subclass or not to Subclass ... Pin
12-Jul-02 20:49
suss12-Jul-02 20:49 
GeneralErrno and a linking problem (again...) Pin
Janine12-Jul-02 3:02
Janine12-Jul-02 3:02 
GeneralRe: Errno and a linking problem (again...) Pin
Joaquín M López Muñoz12-Jul-02 5:53
Joaquín M López Muñoz12-Jul-02 5:53 
GeneralRe: Errno and a linking problem (again...) Pin
Alexandru Savescu12-Jul-02 6:20
Alexandru Savescu12-Jul-02 6:20 
GeneralCToolbar - diable item Pin
jafrazee12-Jul-02 2:59
jafrazee12-Jul-02 2:59 
GeneralRe: CToolbar - diable item Pin
Mike Upton12-Jul-02 3:13
Mike Upton12-Jul-02 3:13 
GeneralRe: CToolbar - diable item Pin
Rage12-Jul-02 3:18
professionalRage12-Jul-02 3:18 
GeneralControls show in different ways in CDialog Pin
sanskypotov12-Jul-02 2:42
sanskypotov12-Jul-02 2:42 
GeneralRunning Visual C++ 6.0 and .Net Pin
Amos Kermisch12-Jul-02 2:33
sussAmos Kermisch12-Jul-02 2:33 
GeneralRe: Running Visual C++ 6.0 and .Net Pin
Alexandru Savescu12-Jul-02 6:18
Alexandru Savescu12-Jul-02 6:18 
GeneralRe: Running Visual C++ 6.0 and .Net Pin
Anonymous13-Jul-02 13:53
Anonymous13-Jul-02 13:53 
Questionhow can i make a transparent dialog in win98 Pin
ttzzgg_8071312-Jul-02 2:31
ttzzgg_8071312-Jul-02 2:31 
AnswerRe: how can i make a transparent dialog in win98 Pin
benjymous12-Jul-02 2:44
benjymous12-Jul-02 2:44 
Questiondictionary, bag ..., what is that? Pin
includeh1012-Jul-02 2:12
includeh1012-Jul-02 2:12 
AnswerRe: dictionary, bag ..., what is that? Pin
Chris Losinger12-Jul-02 3:18
professionalChris Losinger12-Jul-02 3:18 
GeneralRe: dictionary, bag ..., what is that? Pin
includeh1012-Jul-02 3:24
includeh1012-Jul-02 3:24 
GeneralRe: dictionary, bag ..., what is that? Pin
Chris Losinger12-Jul-02 3:26
professionalChris Losinger12-Jul-02 3:26 
AnswerRe: dictionary, bag ..., what is that? Pin
Alexandru Savescu12-Jul-02 6:40
Alexandru Savescu12-Jul-02 6:40 
In STL a dictionary is implemented as a map (maps keys and values) and is a binary tree (a red-black tree under the VC implementation). Thus the tree is kept always sorted by its key, so we have logarithimc insertion and look up time.
A map cannot have duplicate keys. However if you want to use duplicate keys you can used multimap (also part of STL).

Another implemntation is to use a hash_map or hash_multimap (not part of the STL library but most of the STL implementations offer them - VC offers it in VC.NET).

A hash works like this:
you provide a hash function that "hashes" the key and thus you have a hashvalue. your hash_map has a vector of lists. The size of the vector may depend on a given hash size. When you want to insert your object, you hash the key, and with the obtained hashed value you insert the object in the in the list indexed at the hash value (i.e if your hashed value is 5 then you insert your element at the tail of the 5th list).
When you want to lookup an object, given the key, you hash the key and then you perform linear search at the list of the index of the hashed value to find your object

If the hash size is big enough you will have lists with only one element then the insertion and lookup time will be O(1), provided that your hash function is fast enough. (it was O (log(n) for a map). However if your hash size is too small (or you have too many elements in the dictionary) then your lists will be very big so inserting and looking up can be slow. That's why people use map and hash_map also.

Best regards,
Alexandru Savescu
GeneralCOleDispatchDriver Pin
AJ12312-Jul-02 1:09
AJ12312-Jul-02 1:09 
GeneralRe: COleDispatchDriver Pin
AJ12312-Jul-02 5:47
AJ12312-Jul-02 5:47 
GeneralProblems iterating through a std::map Pin
Alexandru Savescu12-Jul-02 0:46
Alexandru Savescu12-Jul-02 0:46 
GeneralRe: Problems iterating through a std::map Pin
Christian Graus12-Jul-02 1:06
protectorChristian Graus12-Jul-02 1:06 
GeneralRe: Problems iterating through a std::map Pin
Alexandru Savescu12-Jul-02 1:14
Alexandru Savescu12-Jul-02 1:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.