Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CMap Efficiency???

CMap Efficiency???

Scheduled Pinned Locked Moved C / C++ / MFC
questionalgorithms
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    Uma Mahes
    wrote on last edited by
    #1

    I have to Map the objects with combined key which forms unique keys. How can i use CMap with 2 compined key?? I thought of placing those 2 keys as structure and using it. If i use structure or class as a key , Will the efficiency will be better than comparing say searching of those values in CArray. How CMap will behave in this case??. I guess the CMap will not be much better in this case. If i lookup for the key , they should also search interally & find the values.Correct me if am wrong. Let me know, Is there any other way to Map the object with multiple ent key? For eg: typedef struct { int no; CString Name; }Key; CMap m_myMap; Thanks & regards, Uma

    B 1 Reply Last reply
    0
    • U Uma Mahes

      I have to Map the objects with combined key which forms unique keys. How can i use CMap with 2 compined key?? I thought of placing those 2 keys as structure and using it. If i use structure or class as a key , Will the efficiency will be better than comparing say searching of those values in CArray. How CMap will behave in this case??. I guess the CMap will not be much better in this case. If i lookup for the key , they should also search interally & find the values.Correct me if am wrong. Let me know, Is there any other way to Map the object with multiple ent key? For eg: typedef struct { int no; CString Name; }Key; CMap m_myMap; Thanks & regards, Uma

      B Offline
      B Offline
      Brian Shifrin
      wrote on last edited by
      #2

      CMap is ok, STL is better.... CMap uses hashbuckets, efficency based on size of the data, hash alg, etc etc etc.. Multiple keys can be achived by multiple maps with . You can reduce initialize penalty, by initializing maps as needed.. Brian

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups