Skip to content

Commit

Permalink
The Perfect Hour ⏱️
Browse files Browse the repository at this point in the history
  • Loading branch information
kantarcise authored Nov 2, 2023
1 parent 39941e4 commit 0a5176d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions neetcode/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -1201,3 +1201,21 @@ you will get the product of all elements.
- for getnewsfeed method. Getting the latest tweets from people that are tweeting
- in their own pace, min_heap helps
- 079.find_median_from_data_stream:
- Of course first approach woul be using a list.
-
- The idea is basically to use two heaps a small and a large heap
- Adding and removing elements from the heap will be o(logn)
-
- Finding the max / min in constant time - o(1)
-
- small heap will be a max heap,
- large heap will be a min heap
-
- Size of the heaps should be approximately Equal
- AT MOST difference of 1.
-
- Also, every element in small heap
- should be smaller than the big heap

0 comments on commit 0a5176d

Please sign in to comment.