Back to Browse

Find Median from Data Stream | Two Heap | Coding Interview

11.0K views
Mar 15, 2020
8:55

In this lesson, we will see how to find the median from the data stream. The problem statement is Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two middle values. Design a data structure that supports the following two operations: void addNum(int num) - Add an integer number from the data stream to the data structure. double findMedian() - Return the median of all elements so far. LeetCode link - Github code link - https://github.com/JayaramachandranAugustin/Interview/blob/master/Algorithm/Heap/find_median_from_data_stream.md #Heap #coding_interview #Median Heap data structure : https://www.youtube.com/watch?v=OISWz2SChJM To prepare for the interview: ----------------------------------- Complete list of questions and answers for cracking the coding interview: https://github.com/JayaramachandranAugustin/Interview Algorithm Tutorial playlist: https://www.youtube.com/watch?v=F4iu-Cd43V4&list=PL01E9IbI2mz9bGKeNRE7vrchhv7icIRbA

Download

0 formats

No download links available.

Find Median from Data Stream | Two Heap | Coding Interview | NatokHD