in reply to Advanced Data Structure Question
Or you could just use a regular binary tree, but rebalance it every x number of items. Assuming you do the rebalancing efficiently (and I'm doing my calculations correctly), rebalancing should be a O(n) process, meaning you can run it every so often without too big a loss in efficiency.
Bottom line, you're making a mountain out of a molehill if it's only 1000 items. You can use arrays and nobody will be able to tell the difference in your prototype. Later on, I'm sure there are 2-3-4 or red/black tree classes for C that you can use with minimal trouble, or you can borrow any algorithms book and write your own class in a few hours.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Advanced Data Structure Question
by traveler (Parson) on Apr 19, 2006 at 20:20 UTC |