in reply to retrieve next avaiable element in sorted hash
Then, you can use a binary search to look up your hash key in the index array and return the next largest key.
This eliminates the sort involved with each lookup, which I would guess is the biggest slowdown to your current code.
It also changes your search from simple to binary, which should cut the search time by an order of magnitude.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: retrieve next avaiable element in sorted hash
by vinforget (Beadle) on Oct 07, 2003 at 20:44 UTC |