1.

What is the minimum possible time complexity to find the number of steps to reach the end of an array?(a) O(n)(b) O(n^2)(c) O(n^3/2)(d) O(1)My question comes from Number of Jumps to Reach End-array Operation topic in chapter Arrays Types of Data Structures & Algorithms II have been asked this question during an interview.

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

Easy explanation - The MINIMUM POSSIBLE time complexity to REACH the end of an ARRAY is O(n). So a linear time complexity is possible.


Discussion

No Comment Found

Related InterviewSolutions