In the first example, we... «Грокаем структуры данных»
fru-n-quiz22 марта 2026In the first example, we add a duplicate of the value at the root of the tree, 6. At the root, we go left, as we always do when we find the same value as the one stored in a node. We traverse this branch until we reach the leaf with the value 5, and we know we can add our new node there.
<…>
In the other case presented, we add the largest value yet in the tree, so we traverse a path to the far right of the tree, and there we add a new node for the value 11.9