Why is storing every root-to-leaf path unnecessary?

Practice this question from Maximum Depth of Binary Tree - Height recursion Pattern Practice Quiz, with options and an explanation.

Question

Why is storing every root-to-leaf path unnecessary?

Option A — Correct answer

Height recursion computes the answer directly

Option B

Paths cannot be stored

Option C

The tree must be sorted first

Option D

BFS is impossible

Explanation

The longest depth can be computed directly with recursive height.

Maximum Depth of Binary Tree - Height recursion Pattern Practice Quiz

All questions · Previous question · Next question

Open on QuizMaker