Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Tiwarishashwat/InterviewCodes
/ add
Method
add
KthLargestElementInAStream.java:12–20 ·
view source on GitHub ↗
(int val)
Source
from the content-addressed store, hash-verified
10
}
11
12
public
int
add(
int
val) {
13
if
(pq.size()<k || val > pq.peek()){
14
pq.offer(val);
15
if
(pq.size()>k){
16
pq.poll();
17
}
18
}
19
return
pq.peek();
20
}
21
}
22
23
/**
Callers
15
KthLargest
Method · 0.95
wordSubsets
Method · 0.45
inorder
Method · 0.45
inorderTraversal
Method · 0.45
checkIfPrerequisite
Method · 0.45
countConsistentStrings
Method · 0.45
preorderTraversal
Method · 0.45
dfs
Method · 0.45
levelOrder
Method · 0.45
eventualSafeNodes
Method · 0.45
equationsPossible
Method · 0.45
solve
Method · 0.45
Calls
no outgoing calls
Tested by
no test coverage detected