AVL Tree : Help, please?
Posted: Mon Mar 19, 2007 4:52 am
Hey people, yes, it's me again.
A quick note - I wasn't asking for people to suddenly correct my code, that isn't my plan.
My plan is simple: I would like to understand how to correct the balances of nodes that are rotated, in LRR, LRL, RLR, RLL cases.
Simple : Left-Heavy, right-heavy, left-right heavy, right-left heavy rebalancing is working just fine. Just, The only thing is - The nodes balances after those special cases (Left-right-left, for example) aren't really being corrected.
So far, my solution is drawing hundreds of AVL diagrams all over any piece of paper I can find and trying to determine what the balances would be after such an operation.
Any help would be greatly appreciated, even if it is a detailed explanation of performing a left or right rebalance.
Im on my knees here people, Im kind of stumped. So far, My code seems to function fine, the problem is I just dont trust it, and I cant trust it until I know for sure that what Im doing to resolve an imbalance is correct.
~Zeii (The helpless)
A quick note - I wasn't asking for people to suddenly correct my code, that isn't my plan.
My plan is simple: I would like to understand how to correct the balances of nodes that are rotated, in LRR, LRL, RLR, RLL cases.
Simple : Left-Heavy, right-heavy, left-right heavy, right-left heavy rebalancing is working just fine. Just, The only thing is - The nodes balances after those special cases (Left-right-left, for example) aren't really being corrected.
So far, my solution is drawing hundreds of AVL diagrams all over any piece of paper I can find and trying to determine what the balances would be after such an operation.
Any help would be greatly appreciated, even if it is a detailed explanation of performing a left or right rebalance.
Im on my knees here people, Im kind of stumped. So far, My code seems to function fine, the problem is I just dont trust it, and I cant trust it until I know for sure that what Im doing to resolve an imbalance is correct.
~Zeii (The helpless)