CSC301: Put: Recursive [15/30] |
public void putLeft (int key) { if (root==null) { root = new Node (key); } else { putLeft (root, key); } } private static void putLeft (Node x, int key) { if (x.left == null) x.left = new Node (key); else { putLeft (x.left, key); } }
Make it recursive.