CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #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.

  2. #2
    Join Date
    Apr 1999
    Posts
    27,449

    Re: Linked List vs Any Data Structure

    Quote Originally Posted by forumuser11@gmail.com View Post
    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

  3. #3
    Join Date
    May 2009
    Posts
    2,413

    Re: Linked List vs Any Data Structure

    Quote Originally Posted by Paul McKenzie View Post
    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
  •  





Click Here to Expand Forum to Full Width

Featured