Problem Challenge 1

Connect All Level Order Siblings (medium) #

Given a binary tree, connect each node with its level order successor. The last node of each level should point to the first node of the next level.

Created with Fabric.js 1.6.0-rc.1 1 2 3 4 5 6 7 null Example 1:
Created with Fabric.js 1.6.0-rc.1 12 7 1 9 10 5 null Example 2:

Try it yourself #

Try solving this question here:

Output

0.466s

Traversal using 'next' pointer: 12

Mark as Completed
←    Back
Connect Level Order Siblings (medium)
Next    →
Solution Review: Problem Challenge 1