🎉 October Learning Month — learn a new software term every day!
An interactive flashcard trainer for software engineering terms.

Kadane

In plain terms

An algorithm for the maximum-sum contiguous subarray.

Going deeper

Kadane's algorithm finds the contiguous subarray with the largest sum in a single linear pass by tracking running and best sums. It's an elegant DP one-liner.

Under the hood

O(n) time, O(1) space; resets the running sum when it dips below zero.

Examples

Max profit windows, signal analysis, contiguous subarray problems.

Think of it like...

Like tracking your best winning streak as you walk through a series of gains and losses.

Feedback & Bug Report