-
March 31st, 2011, 11:25 PM
#1
Linked List vs Any Data Structure
I am storing data in a linked list. Every linked list node contains data,KEY and pointer to the next node. I trying to access the data stored randomly based on the unique KEY. Is there any way by which other data strcture can be used so that search will be faster? pl suggest.
-
March 31st, 2011, 11:39 PM
#2
Re: Linked List vs Any Data Structure
Originally Posted by forumuser11@gmail.com
I am storing data in a linked list. Every linked list node contains data,KEY and pointer to the next node. I trying to access the data stored randomly based on the unique KEY. Is there any way by which other data strcture can be used so that search will be faster? pl suggest.
std::map.
Regards,
Paul McKenzie
-
April 1st, 2011, 12:11 AM
#3
Re: Linked List vs Any Data Structure
Originally Posted by Paul McKenzie
std::map.
Or even faster,
std::tr1::unordered_map
It's a so called hash table.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|