This code demonstrates AVL insertion and deletion. The code was originally written in C by myself a little while back for a tutorial. The translation to Java was fairly trivial, and to add a little excitement I even threw in a few generics. Yes, I'm aware of this line:
tree.data = heir.data;
But thank you for your concern.
There are two significant differences between the C code and the Java code. First, In Java, boolean values cannot be used in integral context. Therefore my yummy design in C is a little bitter in Java because I had to either use the conditional operator to get my logical NOT, or duplicate a lot of code for symmetrical cases. Second, because Java Generics don't lend themselves well to arrays, I chose to use the ArrayList collection rather than a built in array for the links as I did in C.
All in all, a mildly interesting diversion, and now Daniweb has an AVL implementation to its name. :-)