Добавил:
have_a_good_day_honey
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:дерево / Main
.javapublic 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));
}
}