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.

Here's the output:
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.
Topic archived. No new replies allowed.