Balancing an AVL tree

Hey, I'm just having a bit of trouble inserting into an AVL tree and then balancing it.

here's the code for insert and balance.
http://pastebin.com/eu4C8bf5

Here's the output:
http://pastebin.com/is4Gmy7t
As you can see, everything goes fine until I insert 'u', at which point x disappears.

If you need any other information, let me know!
No replies?
No replies?

Well, some topics are harder than others. In my opinion, your thread doesn't even belong in Beginners.

Simply giving out the entire code and say "it's not working, I have no idea why, someone please fix it" is even worse... in the sense that fewer people may be able to help you.

http://en.wikipedia.org/wiki/AVL_tree
http://pages.cs.wisc.edu/~ealexand/cs367/NOTES/AVL-Trees/index.html
Topic archived. No new replies allowed.