Java icon indicating copy to clipboard operation
Java copied to clipboard

[FEATURE REQUEST] Add Boundary Traversal of Binary Tree Problem

Open VShalini01 opened this issue 1 year ago • 3 comments

What would you like to Propose?

Boundary traversal is a Binary tree traversal technique. It includes: left boundary (nodes on left excluding leaf nodes) leaves (consist of only the leaf nodes) right boundary (nodes on right excluding leaf nodes)

Input: Binary tree Output: Boundary traversal (visiting the boundary nodes of the tree in anticlockwise direction, starting from root node)

Approach: Dividing the problem into three parts: left boundary, bottom boundary and right boundary and performing the traversal using recursion.

Issue details

Problem statement: Given a Binary Tree, the objective is to perform boundary traversal.

Test Case: Input: Binary Tree: [1 2 7 3 -1 -1 8 -1 4 9 -1 5 6 10 11] Output: Boundary Traversal: [1, 2, 3, 4, 5, 6, 10, 11, 9, 8, 7] Explanation: Starting from the root, we traverse from: 1 The left side traversal includes the nodes: 2, 3, 4 The bottom traversal include the leaf nodes: 5, 6, 10, 11 The right side traversal includes the nodes: 9, 8, 7 We return the root and the boundary traversal is complete.

Additional Information

No response

VShalini01 avatar Oct 06 '24 04:10 VShalini01

kindly assign this issue to me

ssugam10 avatar Oct 06 '24 09:10 ssugam10

kindly assign this issue to me

keshavkhetan123 avatar Oct 07 '24 12:10 keshavkhetan123

kindly assign this issue to me

Aastha-ojha-20 avatar Oct 07 '24 12:10 Aastha-ojha-20

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution!

github-actions[bot] avatar Nov 09 '24 00:11 github-actions[bot]

Please reopen this issue once you have made the required changes. If you need help, feel free to ask in our Discord server or ping one of the maintainers here. Thank you for your contribution!

github-actions[bot] avatar Nov 18 '24 00:11 github-actions[bot]