What does current mean in Kadane's algorithm?

Practice this question from Maximum Subarray - Kadane Pattern Practice Quiz, with options and an explanation.

Question

What does current mean in Kadane's algorithm?

Option A — Correct answer

The best sum ending at the current index

Option B

The best value in the entire array before scanning

Option C

The current array length

Option D

The count of negative values

Explanation

It is the best subarray sum that must end at the current index.

Maximum Subarray - Kadane Pattern Practice Quiz

All questions · Previous question · Next question

Open on QuizMaker