/* --------------------------------------------------------- Test if Goodrich has a bug in delete 1. Create the base tree 44 / \ 17 78 / \ / \ 12 32 50 88 / / \ 11 48 62 2. delete 32 Observation: I think I know why Goodrich break ties with left left and right right --------------------------------------------------------- */ public class TestProg99 { 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("============================="); // New T.insert(new KeyType("12"), new ValueType(12)); T.printTree(); System.out.println("============================="); T.insert(new KeyType("11"), new ValueType(12)); T.printTree(); System.out.println("============================="); Entry p; p = T.find( new KeyType("32") ); T.remove(p); T.printTree(); System.out.println("============================="); } }