I'm looking for the best way to calculate a nodes balance in an AVL-tree. I thought I had it working, but after some heavy inserting/updating I can see that it's not working correct (at all).
This is kind of a two-part question, the first part would be how to calculate the height of a sub-tree, I know the definition "The height of a no...
I have an ordered list of movies. Each movie has a name and a description. The description length varies. I list the movies one by one in two columns, roughly like this:
1. Blues Brothers | 4. Lord of the Rings
Cheesy movie about two guys. | A hobbit and his buddies go
...
Hello, I am working on an assignment that asks me to implement an AVL tree. I'm pretty sure I have the rotation methods correct, but I'm having trouble figuring out when to use them.
For example, the explanation in the book says that I should climb up the same path I went down to insert the node/element. However, I can't have any parent...