Скачиваний:
0
Добавлен:
13.01.2023
Размер:
927 б
Скачать
public class Main {

    public static void main(String[] args)
    {

        BinaryTree<Integer>.Node root = null;

        BinaryTree<Integer> binaryTree = new BinaryTree<>();

        root = binaryTree.insert(root,10);
        root = binaryTree.insert(root,40);
        root = binaryTree.insert(root,50);
        root = binaryTree.insert(root,20);
        root = binaryTree.insert(root,30);
        root = binaryTree.insert(root,90);
        root = binaryTree.insert(root,70);
        root = binaryTree.insert(root,80);
        root = binaryTree.insert(root,150);
        root = binaryTree.insert(root,140);
        root = binaryTree.insert(root,100);
        root = binaryTree.insert(root,110);
        root = binaryTree.insert(root,120);

        root = binaryTree.remove(root,20);

        root = binaryTree.search(root, 50);

        System.out.println(binaryTree.asString(root));
    }
}
Соседние файлы в папке дерево