@@ -0,0 +1,1364 @@
+package io.github.suzp1984.algorithms.tree;%0A%0A/**%0A * Created by jacobsu on 11/8/16.%0A */%0Apublic class BinarySearchTree%3CKey extends Comparable%3CKey%3E, Value%3E %7B%0A%0A    private Node root;%0A%0A    public void put(Key key, Value value) %7B%0A        root = put(root, key, value);%0A    %7D%0A%0A    public Value get(Key key) %7B%0A        Node x = root;%0A        while (x != null) %7B%0A            int cmp = key.compareTo(x.key);%0A            if (cmp %3C 0) %7B%0A                x = x.left;%0A            %7D else if (cmp %3E 0) %7B%0A                x = x.right;%0A            %7D else %7B%0A                return x.value;%0A            %7D%0A        %7D%0A%0A        return null;%0A    %7D%0A%0A    public void delete(Key key) %7B%0A%0A    %7D%0A%0A    public Iterable%3CKey%3E iterator() %7B%0A%0A    %7D%0A%0A    private Node put(Node x, Key key, Value value) %7B%0A        if (x == null) %7B%0A            return new Node(key, value);%0A        %7D%0A%0A        int cmp = key.compareTo(x.key);%0A%0A        if (cmp %3C 0) %7B%0A            x.left = put(x.left, key, value);%0A        %7D else if (cmp %3E 0) %7B%0A            x.right = put(x.right, key, value);%0A        %7D else %7B%0A            x.value = value;%0A        %7D%0A%0A        return x;%0A    %7D%0A%0A    private class Node %7B%0A        private Key key;%0A        private Value value;%0A        private Node left;%0A        private Node right;%0A        public Node(Key key, Value value) %7B%0A            this.key = key;%0A            this.value = value;%0A        %7D%0A    %7D%0A%7D%0A

add Binary Tree