[LeetCode] Find Median from Data Stream

  • 时间:
  • 浏览:0
  • 来源:uu快3苹果版_uu快3单双_套路

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.