Exemplo n.º 1
0
Arquivo: BST.java Projeto: 9r3y/c47
  /**
   * *************************************************************************** Test client
   * ***************************************************************************
   */
  public static void main(String[] args) {
    BST<String, Integer> st = new BST<String, Integer>();
    for (int i = 0; !StdIn.isEmpty(); i++) {
      String key = StdIn.readString();
      st.put(key, i);
    }

    for (String s : st.levelOrder()) StdOut.println(s + " " + st.get(s));

    StdOut.println();

    for (String s : st.keys()) StdOut.println(s + " " + st.get(s));
  }