Back to course home
0% completed
Solution: Boundary of Binary Tree
Problem Statement
The boundary of the tree is the concatenation of the root, the left boundary, the leaf nodes in left to right order, and the right boundary in the reverse order.
- The left boundary includes all the nodes on the leftmost path from the root, excluding the leftmost leaf.
- The leaf nodes include all nodes that do not have any children, traversed from left to right.
- The right boundary includes all nodes on the rightmost path, excluding the rightmost leaf, but they are recorded in reverse order. Return the values of these boundary nodes in order.
.....
.....
.....
Like the course? Get enrolled and start learning!
Table of Contents
Contents are not accessible
Contents are not accessible
Contents are not accessible
Contents are not accessible
Contents are not accessible