Why is the brute-force approach less ideal here?
Practice this question from Median Finder - Two Heaps Pattern Practice Quiz, with options and an explanation.
Question
Why is the brute-force approach less ideal here?
Option A — Correct answer
Sorting after every operation makes repeated queries slow.
Option B
It always uses constant time
Option C
It avoids all comparisons
Option D
It requires no extra state
Explanation
Sorting after every operation makes repeated queries slow.