Get K Max and Delete K Max in stream of Incoming Integers
Solution 1 : Using Min Heap
Algorithm :
1) Keep a Min & Max Heap of K size 2) Store first K elements
Interview Questions asked in Google, Microsoft, Amazon
by Dhaval Dave
1) Keep a Min & Max Heap of K size 2) Store first K elements
by Dhaval Dave
by Dhaval Dave
by Dhaval Dave
by Dhaval Dave
by Dhaval Dave
Loop Node5 Next pointer is point to Node3 in Singly Linked List 1 ---- 2 ---- 3 ---- 4 ---- 5 |_____________|