Skip to content

Commit 0031397

Browse files
author
Joseph Luce
authored
Update 295_find_median_from_data_stream.md
1 parent e0b058b commit 0031397

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

leetcode/hard/295_find_median_from_data_stream.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ You can think of this as a divide and conquer approach.
4646
The only tricky part is to keep the two heaps balanced, balanced meaning the two heaps cannot differ in size by more than 1.
4747
Secondly, we need to keep the two heap property of smaller and larger sets.
4848

49+
Once these two properties are met, finding the median can be done by using the two values on top of the heap if both heap sizes are the same or taking the top value of the larger heap.
50+
4951
```
5052
class MedianFinder:
5153

0 commit comments

Comments
 (0)