Last updated
Last updated
For an integer array nums
and an integer k
, return the kth
largest element in the array.
To find the element at the place we can use multiple approach
sort the array and find the element at the index. But this will take to sort the array.
we can create a min or max heap and then find the element
we can also use quick select algorithm to find in
#array #quick_select