the time comp. of insertion in heap is 0( log N) and we are inserting n element so our time compl. would be 0( Nlogn )
but the answer is O(N)
please tell me why ?
the time comp. of insertion in heap is 0( log N) and we are inserting n element so our time compl. would be 0( Nlogn )
but the answer is O(N)
please tell me why ?