niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Programming » C++
container for insert/delete + fast index
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
Author Message
Victor Bazarov
*nix forums Guru


Joined: 07 Apr 2005
Posts: 3949

PostPosted: Fri Jul 21, 2006 1:03 pm    Post subject: Re: container for insert/delete + fast index Reply with quote

ndbecker2@gmail.com wrote:
Quote:
I'm looking for an stl-style container that has good performance for
insertion and deletion of elements as well as very fast index
operation.

I'm thinking an stl::list would be good if an external index was
maintained.

I could of course write this, but I wonder if something suitable
already exists?

Nothing's perfect. If you don't need isertions or deletetions in the
middle, use 'deque'. If you do need insertion/deletions all over the
container, you're better off rolling your own indexing with 'list',
as you already mentioned. Beware, though, that 'list' is a memory hog.

As always, to judge performance you need to measure, not guess.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Back to top
Neal Becker
*nix forums beginner


Joined: 15 Sep 2005
Posts: 22

PostPosted: Fri Jul 21, 2006 12:57 pm    Post subject: container for insert/delete + fast index Reply with quote

I'm looking for an stl-style container that has good performance for
insertion and deletion of elements as well as very fast index
operation.

I'm thinking an stl::list would be good if an external index was
maintained.

I could of course write this, but I wonder if something suitable
already exists?
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
The time now is Thu Dec 04, 2008 7:15 am | All times are GMT
navigation Forum index » Programming » C++
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Insert header and footer in every page served by proxy ehmedk Apache 0 Tue Apr 22, 2008 6:27 pm
No new posts Insert header and footer in every page served by squid ehmedk Squid 0 Tue Apr 22, 2008 6:16 pm
No new posts Can a trigger insert records into another oracle server Tauqir Server 2 Fri Jul 21, 2006 12:27 am
No new posts (secondary) index-only scans Ryan Berkeley DB 1 Thu Jul 20, 2006 8:32 pm
No new posts Create index hanging Claire McLister PostgreSQL 7 Thu Jul 20, 2006 8:11 pm

Deals On Products | Electricity Suppliers | Gas Suppliers | Business Credit Card | Mortgage Calculator
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1388s ][ Queries: 20 (0.0716s) ][ GZIP on - Debug on ]