Back to Questions

Binary Tree Paths (DFS)

107.6K viewsAsked at Salesforce
Easy

Question Explain

Given the root of a binary tree, return all root-to-leaf paths as strings. Use Depth-First Search (DFS) with backtracking.

Start Trying This Question Simulation

Practice answering orally or with text to get instant AI feedback.

Practice with This Question