mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-05-22 00:20:25 -04:00
Update and rename k_element_stream.py to kth_largest_stream.py
This commit is contained in:
parent
f75b102b78
commit
66cf6cc427
1 changed files with 1 additions and 4 deletions
|
@ -14,7 +14,6 @@ class KthLargest:
|
|||
while len(self.heap) > k:
|
||||
heapq.heappop(self.heap)
|
||||
|
||||
|
||||
def add(self, val: int) -> int:
|
||||
|
||||
heapq.heappush(self.heap, val)
|
||||
|
@ -22,6 +21,4 @@ class KthLargest:
|
|||
heapq.heappop(self.heap)
|
||||
|
||||
return self.heap[0]
|
||||
|
||||
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue