Solution: Boundary of Binary Tree
Let's solve the Boundary of Binary Tree problem using the Tree Depth-First Search pattern.
We'll cover the following...
We'll cover the following...
Statement
Given the root of a binary tree, return the values of its boundary in order.
The boundary is formed by concatenating the following four parts:
root node itself (the root is never considered a leaf in this problem).