← All problemsSign in

Forgotten Tree 9

CodeChefRating 2557Open on judge ↗

There is a rooted binary tree with $N$ nodes. For each node with exactly two children, one of them is called the left child and the other is called the right child. If a node has only one child, it is still specifically called either the left child or the right child. The nodes are labelled $1$ through $N$ according to the inorder traversal of the tree. That is, the labelling can be generated b

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start