[LeetCode] Find Median from Data Stream

  • 时间:
  • 浏览:2
  • 来源:大发彩神8下载最新版—大发快三官网大发彩神

This post shares a very nice solution using two heaps: a max heap for the smaller half and a min heap for the larger half. The code is rewritten below in C++, simplifying addNum using the logic in Stefan's post.