Duration 8:56

Find Median from Data Stream | Two Heap | Coding Interview

9 160 watched
0
129
Published 15 Mar 2020

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 : /watch/MJhCS2zWSIOWC To prepare for the interview: ----------------------------------- Complete list of questions and answers for cracking the coding interview: https://github.com/JayaramachandranAugustin/Interview Algorithm Tutorial playlist: /watch/AbRIci7vhhcrv7ERNeKGb9zm2IbI9E10LP=tsil&4V34dC-ui4FuI

Category

Show more

Comments - 8