Tip 1 : Practice coding problem
Tip 2 : Have Projects at least 2
Tip 1 : Have some projects on resume
Tip 2 : Be confident to answer



Input: Consider the binary tree A as shown in the figure:

Output: [10, 5, 3, 7, 18, 25, 20]
Explanation: As shown in the figure
The nodes on the left boundary are [10, 5, 3]
The nodes on the right boundary are [10, 20, 25]
The leaf nodes are [3, 7, 18, 25].
Please note that nodes 3 and 25 appear in two places but are considered once.




1. If the list is empty, the function immediately returns None because there is no middle node to find.
2. If the list has only one node, then the only node in the list is trivially the middle node, and the function returns that node.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is recursion?