Skip to main content

Boundary Traversal

Learn Boundary Traversal (Trees, Data Structures & Algorithms) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Tracing the Tree's Outline Boundary traversal prints the tree's OUTER EDGE, counter-clockwise: the left boundary (top to bottom), then all LEAVES (left to right), then the right boundary (bottom to top). Each of the three parts needs its own careful traversal, with rules to avoid duplicating corner nodes.

More lessons in Trees