Dynamic Programming21 sections · 916 units
Open in CourseQuiz: Kadane vs Prefix
Comparing approaches
Check Your Understanding
For maximum subarray sum, which approach is better: Kadane or prefix sum?
- A.Kadane, because it uses O(1) space vs O(n) for prefix sums
- B.They have different time complexities
- C.Neither works for this problem
- D.Prefix sum, because it is more general