1,998 views
1 votes
1 votes

Consider the array of size n. the first (n – 1) elements are already sorted. What is the worst case time complexity to insert a nth element in an array after insertion the array should be in sorted order

  1.   O(1)
  2.   O(n)
  3.   O(n log n)
  4.   O(n2)

2 Answers

Related questions

0 votes
0 votes
2 answers
2
dhruba asked Jun 5, 2023
1,161 views
Binary search is performed on a sorted array of n elements. The search key is not in the array and falls between the elements at positions m and m+1 (where 1 ≤ m < n). ...
3 votes
3 votes
1 answer
3
Akriti sood asked Dec 26, 2016
1,017 views
Consider an array ‘A’ with 2m elements. The elements in odd position are sorted in non-increasing order that is A >= A[3] >= A[5]......A[2m-1] The elements in even p...
8 votes
8 votes
2 answers
4