ended3월 19일· 10 sources

Kadanes Algorithm

카데인 알고리즘 (Kadane's Algorithm)

Why it matters

The article explains how to find the maximum sum of a contiguous subarray using Kadane's Algorithm. It tracks current_sum and max_sum while iterating through the array, deciding at each step whether to extend the current subarray or start fresh. This approach runs in O(n) time by avoiding brute-force enumeration of all subarrays.

10
Sources
+0
24h
Growth
186d
Active
arrayarray algorithmbrute-force optimizationcontiguous subarraycontiguous sumdynamic programminggreedy scanjavakadane's algorithmmaximum subarraymaximum sumpythonsubarraysubarray sum

Sources

Related Issues