Chapter04 - Home

Exercise. This is the solution to exercise 4.1.1 in the book.

Solution. Find-Maximum-Subarray is a maximizer, over a range of elements or over a single element. When all elements of $A$ are negative, the maximum is not a range of elements but a single element. Hence, in this case the algorithm returns the maximum value (least negative element) of the array $A$.