Why use long bounds in Java or C++?

Practice this question from Validate Binary Search Tree - Range bounds Pattern Practice Quiz, with options and an explanation.

Question

Why use long bounds in Java or C++?

Option A — Correct answer

To handle integer extreme node values safely

Option B

To make traversal breadth-first

Option C

To avoid recursion

Option D

To sort the tree

Explanation

Wider bounds avoid false failures when node values equal integer extremes.

Validate Binary Search Tree - Range bounds Pattern Practice Quiz

All questions · Previous question

Open on QuizMaker