import java.util.Scanner; public class TestLLRB { public static void main(String[] args) { Scanner in = new Scanner(System.in); LLRB x = new LLRB(); // Key = String, Value = String String s = "SEARCHEXAMPLE"; //for ( int i = 0; i < s.length(); i++ ) while (true) { System.out.print("Input: "); s = in.next(); System.out.println("\n==============================="); System.out.println("++++++++++ insert: " + s.charAt(0)); System.out.println("==============================="); x.put(""+s.charAt(0), "0"); x.printTree(); } /* System.exit(1); x.put("lion", "roar!!"); x.printTree(); x.put("dog", "woof"); x.printTree(); x.put("tiger", "roar!"); x.printTree(); x.put("cat", "miauw"); x.printTree(); x.put("horse", "brrr"); x.printTree(); x.put("ape", "uh-uh"); x.printTree(); x.put("cow", "moo"); x.printTree(); x.put("donkey", "i-oh"); x.printTree(); x.put("jackal", "a-uuh"); x.printTree(); x.put("owl", "uh-urh"); x.printTree(); x.put("man", "talks"); x.printTree(); x.put("zebra", "hrrrh"); x.printTree(); String k, v; while ( true ) { System.out.print("\n\nEnter a key to search on ==> "); k = in.next(); v = x.get( k ); System.out.println("Key = " + k + " ==> get() returns: " + v); } */ } }