Exemplo n.º 1
0
 /**
  * Unit tests the {@code RedBlackBST} data type.
  *
  * @param args the command-line arguments
  */
 public static void main(String[] args) { 
     RedBlackBST<String, Integer> st = new RedBlackBST<String, Integer>();
     for (int i = 0; !StdIn.isEmpty(); i++) {
         String key = StdIn.readString();
         st.put(key, i);
     }
     for (String s : st.keys())
         StdOut.println(s + " " + st.get(s));
     StdOut.println();
 }