Discussion:
RevAdaptive
(too old to reply)
Nick Whelan
2005-10-02 22:34:52 UTC
Permalink
I'm having a great amount of trouble with the UpdateRevAdaptive function....
does anyone have any psuedocode for it? It works fine until I have to
remove a zero node, and then the whole things goes to hell. Nodes get
overwritten or deleted... either the removeZero is still wrong (even after
the corrected typo on the clarifications page), or I'm missing something
critical in either my updateRevAdaptive or SlideAndDecrement code... What
exactly are you supposed to do once you find a node that's going to be zero?
and what does the comment "/* work down the tree */" mean? If anyone has
any kind of psuedocode for either of these functions and is willing to
share, it would be greatly appreciated.
Jamie Hargrove
2005-10-03 05:32:07 UTC
Permalink
User-Agent: OSXnews .10/b
Xref: number1.nntp.dca.giganews.com utexas.class.cs337:386

If you read removeZero, it never uses the index you pass it as far as I
can tell... if you aren't already, I'd suggest swaping and sliding it
first so that the tree is correct but with a zero node, which should be at
index 0 as removeZero appears to assume.-Jamie
Post by Nick Whelan
I'm having a great amount of trouble with the UpdateRevAdaptive function....
does anyone have any psuedocode for it? It works fine until I have to
remove a zero node, and then the whole things goes to hell. Nodes get
overwritten or deleted... either the removeZero is still wrong (even after
the corrected typo on the clarifications page), or I'm missing something
critical in either my updateRevAdaptive or SlideAndDecrement code... What
exactly are you supposed to do once you find a node that's going to be zero?
and what does the comment "/* work down the tree */" mean? If anyone has
any kind of psuedocode for either of these functions and is willing to
share, it would be greatly appreciated.
.
Loading...