Re: Data structure for fast associative array with lookup by both key and index
- From: Gene <gene.ressler@xxxxxxxxx>
- Date: 28 May 2007 14:22:56 -0700
On May 26, 2:17 pm, CBFalconer <cbfalco...@xxxxxxxxx> wrote:
Gene wrote:
On May 26, 5:23 am, "A.J." <naijir...@xxxxxxxxx> wrote:
I'm looking for a data structure for an associative array with the
following properties:
... snip ...
CBFalconer's hashlib is excellent, but I'm guessing from your design
that you need deletions to "collapse" the array index space so there
are no holes. I can't see a way this can be done in O(1). The order
stats tree is a nice O(log n) solution. You pay O(log n) on insert
(with respect to a hash table e.g.) in order to allow deletions to be
O(log n) rather than O(n).
Thanks. However hashlib can do O(1) deletions. The hashwalk
function allows compression to a single list at any time (O(N)).
The result is invalid after further insertion/deletions, but will
survive searches. It also seems to be accurate, in that I have had
no reports of flaws in several years.
--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/42
<http://www.aaxnet.com/editor/edit043.html>
<http://kadaitcha.cx/vista/dogsbreakfast/index.html>
cbfalconer at maineline dot net
--
Posted via a free Usenet account fromhttp://www.teranews.com
Thanks. But I guess I'm not clear on what you're proposing. If you
add A, C, D to initially empty x then x[1]=A, x[2]=C, x[3]=D. Now
delete A. You are saying that moving C and D to positions x[1] and
x[2] will require O(n). Yes? With the order statistics tree, the
deletion remains O(log n). That's what I was getting at.
.
- Follow-Ups:
- References:
- Prev by Date: Re: fragmentation
- Next by Date: Re: Schools working to overhaul the art of computer programming (The Columbian)
- Previous by thread: Re: Data structure for fast associative array with lookup by both key and index
- Next by thread: Re: Data structure for fast associative array with lookup by both key and index
- Index(es):