AlgoViz

Kadane's algorithm

medium 16 min

Find the contiguous subarray with the largest sum in one pass.

Check yourself

One question at a time. Each answer explains why.

Question 1 of 10

Score 0
applied

For [-5, 10, -3], what happens at index 1?

Pick an answer to see why.

Flashcards

Say your answer, then reveal it.

Card 1 of 10

Recall

What problem does Kadane's algorithm solve?

Say your answer, then reveal it.

These cards come back in Today, just before you would forget them.