adplus-dvertising
frame-decoration

Question

If the array is already sorted, then the running time for merge sort is:

a.

O(1)

b.

O(n*log n)

c.

O(n)

d.

O(n²)

Answer: (b).O(n*log n)

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. If the array is already sorted, then the running time for merge sort is:

Similar Questions

Discover Related MCQs

Q. Which algorithm is having highest space complexity?

Q. Which is the best data structure for round robin algorithm for CPU scheduling?

Q. Time complexity of binary search algorithm is constant.

Q. The time complexity of linear search is given by:

Q. The time complexity of binary search is given by:

Q. If for an algorithm time complexity is given by O((3/2)ⁿ) then complexity will:

Q. If for an algorithm time complexity is given by O(n²) then complexity will:

Q. If for an algorithm time complexity is given by O(n) then complexity of it is:

Q. If for an algorithm time complexity is given by O(log2n) then complexity will:

Q. If for an algorithm time complexity is given by O(1) then complexity of it is:

Q. To measure Time complexity of an algorithm Big O notation is used which:

Q. The worst case complexity of quick sort is

Q. The worst case complexity for insertion sort is

Q. The complexity of Fibonacci series is

Q. What does it mean when we say that an algorithm X is asymptotically more efficient than Y?

Q. The worst case occur in quick sort when

Q. Let m, n be positive integers. Define Q (m, n) as Q (m, n) = 0, if m>n Then Q (m, 3) is (a div b, gives the quotient when a is divided by b)

Q. Using the standard algorithm, what is the time required to determine that a number n is prime ?

Q. Which of the following sorting algorithms does not have a worst case running time of O(n2)?

Q. The concept of order (Big O) is important because