Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Find Median from Data Stream

Design a structure supporting add x and median. Print the median (with one decimal place) for every median operation.

Constraints

1 <= q <= 5 * 10^4 -10^5 <= x <= 10^5 median is only called when at least one number was added

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.