Pattern 22: LeetCode Interview Patterns24 sections · 736 units
Open in CourseQuiz: Streaming Median
Test your understanding
Check Your Understanding
To find the median efficiently as numbers stream in, how many heaps do you need?
- A.One min-heap for all elements
- B.One max-heap for all elements
- C.Three heaps for small, medium, and large values
- D.Two heaps: max-heap for smaller half, min-heap for larger half