AlgoFrames

Label the parts of a tree

Warm-up · Match the pairs · about 3 min

Look at the tree in the example. Match each term to the node or number it describes.

Example 1

Input:

{"levelOrder":[1,2,3,4,5,null,6,null,null,7]}

Output:

see the pairs

1 is at the top. 4, 7 and 6 have no children.

Constraints

  • Each term matches exactly one item

Learn the idea first: Trees: root, leaf, depth, height, subtree, a visual lesson.

More Trees: root, leaf, depth, height, subtree problems