CSC301: Put: Remember what you've made [14/30] Previous pageContentsNext page

    public void putLeft (int key) {
        if (root==null) {
            root = new Node (key);
        } else {
            Node x = root;
            while (x.left != null) {
                x = x.left;
            }
            x.left = new Node (key);
        }
    }

Previous pageContentsNext page