бинарное-дерево

Balancing a binary tree

You need to balance the binary tree without using the height field for the element. I see this algorithm so that after each i ... d be very grateful if you can help with the code. P. s I know it's time-inefficient, but that's exactly what the problem is.

Deleting a binary tree in C++

Help find the memory leak in the following binary tree implementation. Maybe someone is too lazy to dig into such a piece of ... (5); tree->Add(4); tree->Add(2); tree->View(); delete tree; } Thank you, if anyone is too lazy to dig into this

How do I print a binary tree? To output numbers?

I wrote a binary tree algorithm, but I output some encrypted codes instead of a tree, please tell me how to write the last li ... left) res=res+self.depth_first(root.right) a=Node(1) a.insert(2) a.insert(3) a.insert(0) a.printTree(a.root)

Binary tree and red black tree

Someone can explain to me what is the difference between a red-black tree and a binary tree, I see the difference only in the ... the tree when it becomes unbalanced, is it not possible to do the same in a binary tree without marking, I can also rebuild.

C++ Symmetric binary tree traversal without recursion

Good afternoon! There is a non-recursive function that performs a symmetric tree traversal. Instead of a stack, I used soundb ... According to the algorithm, it should be so, but apparently it is implemented in a different way. How can I fix it to work?

Deramida with turns

The deramide is constructed as a normal binary search tree, but each element is additionally assigned a priority field, accor ... node with zero fields for root, and because of this, an extra element is output during the crawl. Https://ideone.com/1ZDuxS

Implementing a binary tree (C#) without using built-in classes and collections

The method of adding a new node does not work. class BinaryTree { class BinaryNode //узел дерева { ... for the right and left subtree). current.right = new BinaryNode(value); current = current.right; What could be wrong here?

Non-recursive traversal of a binary tree without a stack

You need to build a non-recursive binary tree traversal algorithm that has the following properties: A tree of n nodes is t ... on the topic is the Morris bypass, but this algorithm temporarily converts the tree is a "stitched" tree, so it doesn't fit.

A graphical library for visualizing a binary search tree

My task is to visualize a binary search tree using C++ and the graphics libraries supported by the language. The size of th ... Actually, the question is-what is the best library to use for this kind of tasks, and maybe there are some simple examples?

Copy of the tree in C++

A simple and at the same time interesting task appeared in the work. You need to write a function that will copy the tree. C or C++, preferably in C++.

Drawing a tree in Windows Forms

I have a problem with AutoScroll and drawing (the gist of the question is after the code). I use this code to draw an AVL tre ... .GetRoot()); panel1.BackColor = Color.Yellow; panel1.Region = new Region(myPath); } } }