Why is the brute-force approach less ideal here?

Practice this question from Longest Increasing Subsequence - Binary Search DP Pattern Practice Quiz, with options and an explanation.

Question

Why is the brute-force approach less ideal here?

Option A — Correct answer

The O(n^2) DP compares every pair of indexes.

Option B

It is always constant time

Option C

It avoids all repeated states

Option D

It works only on trees

Explanation

The O(n^2) DP compares every pair of indexes.

Longest Increasing Subsequence - Binary Search DP Pattern Practice Quiz

All questions · Previous question · Next question

Open on QuizMaker