Having presented the general framework for describing and analyzing algorithms,
we now present a case study in algorithm analysis to make this discussion more
concrete. Specifically, we show how to use the big-Oh notation to analyze three
algorithms that solve the same problem but have different running times.
The problem we focus on is one that is reportedly often used as a job interview
question by major software and Internet companies—the maximum subarray
problem. Here, we are given an array of integers and asked to find the subarray
whose elements have the largest sum. See the example of Figure 1.13. That is,
given array A = [a1, a2, ..., an], find indices j and k that maximize the sum