Can we use this implementation to sort array of integers as the result is is sorted order.
If yes, then will this sorts the element in O(logn) time ?
Can we use this implementation to sort array of integers as the result is is sorted order.
If yes, then will this sorts the element in O(logn) time ?
@vaishnavtannu yes you can but complexity to sort will be nlogn because insertion of n elements you have to do in heap so nlogn . so why bother just use sort stl
dont forget to hit like and mark resolved if cleared