avl tree implementation in java
avl tree implementation in java public class avlTree { class Node{ int data ; Node left ; Node right ; int height ; Node ( int data){ this . data =data ; this . left = null; this . right = null; this . height = 0 ; } } public int getheight (Node n){ if (n== null ) return - 1 ; int lh=getheight(n. left ) ; int rh=getheight(n. right ) ; int fh=Math. max (lh , rh)+ 1 ; return fh ; } public int getbalancefac (Node n){ if (n== null ) return 0 ; return getheight(n. left )-getheight(n. right ) ; } public Node rightRotate (Node a){ Node b=a. left ; Node br=b. right ; b. right =a ; a. left =br ; a. height =Math. max (getheight(a. left ) , getheight(a. right ))+ 1 ; b. height =Math. max (getheight(b. left ) , getheight(b. right ))+ 1 ; return b ; } ...