[Java] Leetcode 295. Find Median from Data Stream [Two Heaps #1]

preview_player
Показать описание
In this video, I'm going to show you how to solve Leetcode 295. Find Median from Data Stream which is related to Two Heaps.

Here’s a quick rundown of what you’re about to learn:

⭐️ Course Contents ⭐️
⌨️ (0:00) Question
⌨️ (1:28) Solution Explain
⌨️ (8:20) Code

In the end, you’ll have a really good understanding on how to solve Leetcode 295. Find Median from Data Stream and questions that are similar to this Two Heaps.

Рекомендации по теме
Комментарии
Автор

I enjoyed this. My only comment would be I had to slow video down to 0.75x so my brain could process what you were saying properly. Possible suggestion would be to speak slightly slower and maybe I can catch what you are saying the first time around, instead of me having to play the parts I missed back several times. Still really good explanations though, I understand this concept now, ty.

csquaredgaming
Автор

looks promising, well explained, thanks Eric

SHSelect
Автор

public double findMedian() {
if(size%2!=0) return maxheap.size() > minheap.size() ? (double) maxheap.peek() : (double) minheap.peek();
return (maxheap.peek()+ minheap.peek()) / 2.0;

}

sunisshining
welcome to shbcf.ru