|
|
|
|
|
|
| Author |
Message |
Neal Becker *nix forums beginner
Joined: 15 Sep 2005
Posts: 22
|
Posted: Fri Jul 21, 2006 12:57 pm Post subject:
container for insert/delete + fast index
|
|
|
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 |
|
 |
Victor Bazarov *nix forums Guru
Joined: 07 Apr 2005
Posts: 3949
|
Posted: Fri Jul 21, 2006 1:03 pm Post subject:
Re: container for insert/delete + fast index
|
|
|
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 |
|
 |
Google
|
|
| Back to top |
|
 |
|
|
The time now is Sat Nov 22, 2008 8:07 pm | All times are GMT
|
|
Online Advertising | Agencia de turismo | Cheapest mobile phones | Debt Consolidation | Anime
|
|
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
|
|