1 31 package org.objectweb.proactive.examples.binarytree; 32 33 public class TestBT { 34 35 public static void main(String [] args) { 36 BinaryTree myTree = new BinaryTree(); TestBT.useBTree(myTree); 47 } 48 50 protected static void useBTree(BinaryTree bt) { 51 ObjectWrapper s1; 52 ObjectWrapper s2; 53 bt.put(1, "one"); bt.put(2, "two"); 55 bt.put(3, "three"); 56 bt.put(4, "four"); 57 System.out.println("Value associated to key 2 is " + bt.get(2)); 63 System.out.println("Value associated to key 1 is " + bt.get(1)); 64 System.out.println("Value associated to key 3 is " + bt.get(3)); 65 System.out.println("Value associated to key 4 is " + bt.get(4)); 66 bt.put(2, "twoBis"); 68 s2 = bt.get(2); bt.put(2, "twoTer"); 70 s2 = bt.get(2); s1 = bt.get(1); System.out.println("Value associated to key 2 is " + s2); System.out.println("Value associated to key 1 is " + s1); } 76 } | Popular Tags |