In the first example, we... «Грокаем структуры данных»

  • Аватар пользователя
    fru-n-quiz
    22 марта 2026
    In 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