Boundary of Binary Tree

Understand and solve the interview question "Boundary of Binary Tree".

Description

Let’s start by defining what a boundary of a binary tree is. We can define it as:

The boundary of a binary tree is the concatenation of the root, the left boundary, the leaves ordered from left-to-right, and the reverse order of the right boundary. Take a look at the example given below:

Take a look at the example given below:

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.