Learn
Practice
Newsletter
Resources
F
Toggle theme
0
F
Toggle theme
0
Toggle menu
← Back to All Animations
Kth Largest Element in a Stream
Bookmark
Input
Example 1
k=1
Duplicates
Custom
nums
=
[4, 5, 8, 2]
,
k
=
3
,
addCalls
=
[3, 5, 10, 9, 4]
nums
4
5
8
2
add() calls
3
5
10
9
4
Min-Heap (size 0 ≤ 3)
(empty)
algo
master
.
io
Step:
Start: Initialize KthLargest with k=3 and nums=[4,5,8,2]
0 / 21
Input
Example 1
k=1
Duplicates
Custom
nums
=
[4, 5, 8, 2]
,
k
=
3
,
addCalls
=
[3, 5, 10, 9, 4]
0 / 21
nums
4
5
8
2
add() calls
3
5
10
9
4
Min-Heap (size 0 ≤ 3)
(empty)
algo
master
.
io
Step:
Start: Initialize KthLargest with k=3 and nums=[4,5,8,2]