Loading...
Is this your company?
How to compute top k numbers in an array?
Anonymous
using min heap.. create min heap of fist 5 elements form array while(i
But yes, selection algorithm has better running time complexity
using min-heap, complexity is O(N * logK)
Check out your Company Bowl for anonymous work chats.
Get actionable career advice tailored to you by joining more bowls.
Stay ahead in opportunities and insider tips by following your dream companies.
Get personalized job recommendations and updates by starting your searches.