Home »
MCQs »
Algorithms MCQs
What is the primary purpose of Kadane's Algorithm?
48. What is the primary purpose of Kadane's Algorithm?
- To find the shortest path in a graph
- To find the largest sum of a contiguous subarray
- To sort an array
- To find the minimum sum of a contiguous subarray
Answer
The correct answer is: B) To find the largest sum of a contiguous subarray
Explanation
Kadane's Algorithm is used to find the subarray with the largest sum within a given array.