In a min heap of n elements, the Kth smallest element can be found in?
O(n) O(nlogn) O(logn) O(1).
According to me ans should be O(n), say we can have a case where k=n, then we can only find the smallest element in the leaf nodes, which will contain n/2 elements and we need to search O(n/2), i.e. O(n). Is my approach correct?