Logo
Grokking the Coding Interview: Patterns for Coding Questions
Ask Author
Back to course home

0% completed

Problem Challenge 1: Connect All Level Order Siblings (medium)

Problem Statement

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.

Constraints:

  • The number of nodes in the tree is in the range [0, 2<sup>12</sup> - 1].
  • -1000 <= Node.val <= 1000

Try it yourself

Try solving this question here:

.....

.....

.....

Like the course? Get enrolled and start learning!