Connecting Tech Pros Worldwide Help | Site Map

Link List with Tree behaviour

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 22nd, 2005, 11:32 PM
MTT
Guest
 
Posts: n/a
Default Link List with Tree behaviour

Hi there

I like to know if any class avilable before proceeding on my work.

I need a inverted list behaviour for sequential access of elements for
both direction (previous(),next()) also search element if exist or not
and locate position. Since sequential iteration for search is costly I
like to have access by b-tree behaviour.

Hence I will deal with some large counts of elements (in several K),
memory utilization and search time is my concern.

I'm planning to use sorted arrays as list elements (as clusters)
(enable me b-seacrh in node and reduce node count). planning to
construct a balanced b-tree over these nodes (by include left & right
links).

Any help will be appritiated.


  #2  
Old July 22nd, 2005, 11:32 PM
Derrick Coetzee
Guest
 
Posts: n/a
Default Re: Link List with Tree behaviour

MTT wrote:[color=blue]
> I need a inverted list behaviour for sequential access of elements for
> both direction (previous(),next()) also search element if exist or not
> and locate position. Since sequential iteration for search is costly I
> like to have access by b-tree behaviour.
>
> Hence I will deal with some large counts of elements (in several K),
> memory utilization and search time is my concern.[/color]

I believe std::set will work fine for you here. You can iterate through
it in both directions, and check if an element exists and get an
iterator to its position with find(). It will order the elements
according to a less-than predicate which you specify. You might also
consider SGI's non-standard hash_set
(http://www.sgi.com/tech/stl/hash_set.html), a hash-table based set
which has similar capabilities and space/time advantages in some
applications.
--
Derrick Coetzee
I grant this newsgroup posting into the public domain. I disclaim all
express or implied warranty and all liability. I am not a professional.
  #3  
Old July 22nd, 2005, 11:32 PM
Joaquín M López Muñoz
Guest
 
Posts: n/a
Default Re: Link List with Tree behaviour

MTT wrote:[color=blue]
> Hi there
>
> I like to know if any class avilable before proceeding on my work.
>
> I need a inverted list behaviour for sequential access of elements[/color]
for[color=blue]
> both direction (previous(),next()) also search element if exist or[/color]
not[color=blue]
> and locate position. Since sequential iteration for search is costly[/color]
I[color=blue]
> like to have access by b-tree behaviour.
>
> Hence I will deal with some large counts of elements (in several K),
> memory utilization and search time is my concern.
>
> I'm planning to use sorted arrays as list elements (as clusters)
> (enable me b-seacrh in node and reduce node count). planning to
> construct a balanced b-tree over these nodes (by include left & right
> links).
>[/color]

I am not sure if this is what you're after, but the
Boost Multi-index Containers Library
(http://boost.org/libs/multi_index/doc/index.html) allows
you to obtain (among other possibilites) a type of
container that behaves like a std::list while having
fast (O(log n)) key-based lookup at the same time. Check
the section entitled "A bidirectional list with fast lookup"
at the tutorial. Hope this helps,
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.