taocp

This site has no text of the book. Keep your own copy of TAOCP next to it. See what is checked.

Exercise · Volume 1 · 2.3-9

Exercise 2.3-9

not stated yet in Lean solution written

Rating00
KindK3, find a value: compute a number, a set or a closed form from the written solution
SectionSection 2.3 of Volume 1

The task

In the two binary trees of equation (1) of the text, which node is the root, BB or AA?

The exact wording is in your copy of the book.

Hints

Open one hint at a time. Try the exercise again after each.

Hint 1

In the usual diagram, where is the root drawn?

Solution

Show the solution

The root is drawn at the top. In both diagrams of (1), node AA is above node BB. So the root is AA. The two trees differ in the side on which BB hangs: it is the left subtree of AA in one tree and the right subtree in the other.

Answer: AA.

Check

The two diagrams have the same shape as ordinary trees (a root with one child), but they are different binary trees.

Remarks

This is the example that shows that left and right subtrees are not the same, so a binary tree is not a special tree.

This solution is drafted, and a person has not reviewed it yet. The source.

In Lean

not stated yet The exercise is not stated in Lean yet.

The status is computed from the Lean build. The node of the map.

Something is wrong? Report it.