Bob and BST Permutations
CodeChefOpen on judge ↗
Alice has recently taken a fascination for zigzag shaped trees. A zigzag tree is a binary tree where each node has at most one child and the child type alternates(i.e., a node which is a left child of its parent can have only a right child and a node which is a right child of its parent can only have a left child). The root can have either the left or the right child. You can see this from figure
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.
Sign in to chat with the tutor and save your progress.
Sign in to start