Brian Alliet
2004-04-10 01:21:44 UTC
I was just about to implement grow() in BalancedTree but I hit a snag.
When we grow() the numbers of each node obviously are going to change.
That means the root node in every BalancedTree instance needs to
change. Unfortunately we have no way of getting a reference to every
BalancedTree instance. Without doing something ugly with weak pointers
I don't think it is possible.
One thing I was thinking of doing is adding an extra layer of
indirection for the root node. BalancedTree would contain a static
array of root nodes and each BalancedTree instance would point to one
element of that arrray. (That is called a handle right?)
Anybody else have any suggestions?
-Brian
When we grow() the numbers of each node obviously are going to change.
That means the root node in every BalancedTree instance needs to
change. Unfortunately we have no way of getting a reference to every
BalancedTree instance. Without doing something ugly with weak pointers
I don't think it is possible.
One thing I was thinking of doing is adding an extra layer of
indirection for the root node. BalancedTree would contain a static
array of root nodes and each BalancedTree instance would point to one
element of that arrray. (That is called a handle right?)
Anybody else have any suggestions?
-Brian