1.

What is the best case time complexity of Tim sort?(a) O(n)(b) O(n log n)(c) O(n^2)(d) O(log n)The question was posed to me by my college director while I was bunking the class.My question is taken from Sorting in division Sorting of Data Structures & Algorithms II

Answer»

Right OPTION is (a) O(N)

For EXPLANATION: Best case time complexity of Tim sort occurs when the input array is already sorted. In such a case only ONE run will be required.



Discussion

No Comment Found

Related InterviewSolutions