Leetcode 117. Populating Next Right Pointers in Each Node II
Populate each node's next pointer to point to its immediate right neighbor on the same level (or NULL if none) in a binary tree that may be incomplete. The challenge is to perform this in-place with only constant extra space (recursive stack space allowed).
Asked at:
Meta
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Mid October, 2025
Meta
Staff
Given a binary tree, link all the nodes at the same level of the tree.
Hello Interview Premium
Your account is free and you can post anonymously if you choose.