GL
GrindLens
PatternsSheetsPricingQuestions
  1. Home
  2. /Patterns
  3. /Two Heaps (Median Maintenance)
←All Patterns
HeapEvidence Contributing

Two Heaps (Median Maintenance)

Balance a max-heap of the lower half against a min-heap of the upper half to maintain a running median.

Practice Problems: 1
Difficulty: 0 Easy·0 Medium·1 Hard

Core technique

Review the technique, then try the mapped problems below. The right approach depends on each problem's constraints.

  • Core Strategy: Balance a max-heap of the lower half against a min-heap of the upper half to maintain a running median.

Canonical Practice Problems

1 problem
1.Find Median from Data StreamHard
Solve on LeetCode↗

Curated Sheets Containing This Pattern

Blind 75

1 problem

→

LeetCode Top Interview 150

1 problem

→

NeetCode 150

1 problem

→

NeetCode All

1 problem

→

Striver A2Z

1 problem

→

Striver SDE Sheet

1 problem

→

Related Algorithmic Patterns

Heap

Heap for Top-K / Kth Element

Heap

Quickselect

GL
GrindLens

Precision pattern analytics and curated sheet tracking for algorithmic coding interview preparation.

Quick lookup:⌘Kor/

Platform

  • Patterns→
  • Sheets→
  • Pricing→

Community

  • Feedback
  • Report a bug
  • X
  • LinkedIn

© 2026 GrindLens. LeetCode is a trademark of LeetCode. GrindLens is an independent analytics platform and is not affiliated with or endorsed by LeetCode.

Terms of ServicePrivacy Policy