Find the kth minimum element in an array without sorting
Anonymous
If the array is not sorted then we can use min heap to get kth smallest element. 1. Forming a Min heap O(n logn) complexity. 2. For values 1 to k, remove elements from root and re-form the heap O(k logn) complexity
Check out your Company Bowl for anonymous work chats.