/* --------------------------------- Demo Delete 1. Create the base tree 44 / \ 17 78 \ / \ 32 50 88 / \ 48 62 2. delete 32 --------------------------------- */ public class TestProg5 { public static void main(String[] args) { AVLTree T = new AVLTree(new KeyComp()); T.insert(new KeyType("44"), new ValueType(2)); T.printTree(); System.out.println("============================="); T.insert(new KeyType("17"), new ValueType(12)); T.printTree(); System.out.println("============================="); T.insert(new KeyType("78"), new ValueType(12)); T.printTree(); System.out.println("============================="); T.insert(new KeyType("32"), new ValueType(12)); T.printTree(); System.out.println("============================="); T.insert(new KeyType("50"), new ValueType(12)); T.printTree(); System.out.println("============================="); T.insert(new KeyType("88"), new ValueType(12)); T.printTree(); System.out.println("============================="); T.insert(new KeyType("48"), new ValueType(12)); T.printTree(); System.out.println("============================="); T.insert(new KeyType("62"), new ValueType(12)); T.printTree(); System.out.println("============================="); Entry p; p = T.find( new KeyType("32") ); T.remove(p); T.printTree(); System.out.println("============================="); } }