Re: memory pool algorithms

"Tom Plunket" <[email protected]>
Newsgroups gmane.games.devel.algorithms
Message-ID <[email protected]>
> Could you define "retrieve by index" further?  Do you mean that if "n"
> elements are allocated they must be reachable by a number with 0 and
> n-1?  If yes, you obviously can't have constant-time deletion, since
> you'll have a mean of n/2 references to change for every deletion.
> And if you allow holes to get constant-time deletion, what properties
> do you want from your index that a pointer would not have?

You only need to swap the last element into the deleted element, unless
the order of the elements need to match the order of allocation.  Hence
O(1) for all operations, and it can be highly memory-efficient as well.

-tom!


------------------------------------------------------------------------------
Crystal Reports &#45; New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty&#45;free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
GDAlgorithms-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.