in reply to Data structure challenge
This is an interesting question.
If I read you correctly, it is like this: you could get an only slightly slower solution by using a hash, or better, a binary tree instead of the uninitialized array A (with a binary tree, you get O(log n) instead of O(1) for each operation). In fact, this is true no matter how you use an uninitialized array, that is, you can always use a hash or a binary tree instead of one.
Notice however, that if you use such a data structure only once, and you use the efficent C implementation, the OS still has to initialize the array when the process gets the memory by calling brk or mmap.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Data structure challenge
by Abigail-II (Bishop) on Mar 18, 2004 at 12:54 UTC | |
by ambrus (Abbot) on Mar 18, 2004 at 14:15 UTC | |
|
Re: Re: Data structure challenge
by dragonchild (Archbishop) on Mar 18, 2004 at 12:30 UTC |