Search⌘ K
AI Features

Challenge: Print All the Paths

Explore how to print every path from the root to the leaves in a binary tree using Go. This lesson guides you through traversing tree structures and outputting paths clearly, enhancing your understanding of recursion and tree traversal techniques.

Problem

Given a binary tree, print all the paths from the root to the leaves.

Input

The root of a binary tree.

Output

Display all paths in the binary tree.

Sample input

The root ...