Boundary Traversal of Binary Tree : GeeksforGeeks

Problem link: http://www.geeksforgeeks.org/boundary-traversal-of-binary-tree/

Problem Statement:
Given a binary tree, print boundary nodes of the binary tree Anti-Clockwise starting from the root.

Solution Idea:
Recursively, print the left side (Top-down manner), then recursively print the bottom(Left-right manner), and finally recursively print the right side (Bottom-up manner). Just make sure that you do not print the corner nodes twice.

Solution Gist:

Advertisements

Tagged: , , , , , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: