Why is the brute-force approach less ideal here?

Practice this question from LRU Cache - Hash Map Plus Recency List Pattern Practice Quiz, with options and an explanation.

Question

Why is the brute-force approach less ideal here?

Option A — Correct answer

Array scanning makes operations O(n).

Option B

It always uses no memory

Option C

It avoids all state changes

Option D

It only works for binary search

Explanation

Array scanning makes operations O(n).

LRU Cache - Hash Map Plus Recency List Pattern Practice Quiz

All questions · Previous question · Next question

Open on QuizMaker