1.

What is the best case time complexity of library sort?(a) O(n)(b) O(n log n)(c) O(n^2)(d) O(log n)The question was posed to me during an interview.This interesting question is from Sorting in chapter Sorting of Data Structures & Algorithms II

Answer» CORRECT choice is (a) O(n)

For explanation: The best case time COMPLEXITY of library SORT is O(n). It occurs in the case when the input is already/almost sorted.


Discussion

No Comment Found

Related InterviewSolutions