×

Multiple-Choice Questions

What is the primary purpose of Kadane's Algorithm?

48. What is the primary purpose of Kadane's Algorithm?

  1. To find the shortest path in a graph
  2. To find the largest sum of a contiguous subarray
  3. To sort an array
  4. 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.

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.