1.

What is the space complexity of the divide and conquer algorithm used to find the maximum sub-array sum?(a) O(n)(b) O(1)(c) O(n!)(d) O(n^2)This question was addressed to me in my homework.My query is from Maximum Sum of Continuous Subarray topic in section Dynamic Programming of Data Structures & Algorithms II

Answer»

The CORRECT OPTION is (b) O(1)

The best explanation: The DIVIDE and conquer algorithm USES a constant SPACE. So, the space complexity is O(1).



Discussion

No Comment Found

Related InterviewSolutions