This is an old revision of the document!
Table of Contents
Chapter 5
5.1: A First Recurrence: The Mergesort Algorithm
This section begins the chapter meant to break down and discuss several divide and conquer algorithms. We begin with the familiar Mergesort. This algorithm involves breaking up the input into smaller groups, organizing each group, and putting them back together. To use the book's words. The underlying concept is “Divide the input into two pieces of equal size; solve the two subproblems on these pieces separately by recursion; and then combine the two results into an overall solution, spending only linear time for the initial division and final recombining.” There are two main ways to solve a recurrence. The first is to unroll the recursion. The second way is guess and check. To unroll a recursion, first you analyze the first few levels of the recursion. Then we identify a pattern. Then, we sum over all levels of recursion. We can substitute (akin to guess and check) in two main ways. We can substitute an exact solution. Alternatively, we can test one that still contains variables for constants and look for solutions.
This section serves as a good introduction by applying the concept to a familiar problem. The section also did so concisely. I give the section a 7/10.
5.2: Further Recurrence Relationships
This section attempts to break down recurrence relationships into classes in order to allow for generalization aimed at simplifying the problem and solution. In the case of Mergesort, we break up the problem into 2 subproblems, each half the size of the original. Another class of problem involves breaking up the problem into more than 2 subproblems. Similarly to before, we analyze the first few levels, identify a pattern, and sum over all levels of recursion. From this process, if q is the number of subproblems, we get that the class is bounded by O(n^(log2(q)). When working with problems with one subproblem, a similar process yields that the class of problems is bounded in O(n). From all of this, we are led to discuss what the number of subproblems does. Effectively, when q is 1, the run time comes from the top level, when q is greater than 2, it comes from the work done on the constant size subproblems. When q is 2, the work is divided evenly, which yields O(nlogn).
This section is extremely important. The last section simply illustrated a concept, but this section gives information on any recurrence problem we may face. It simply presents us with information (the upper bound on runtime for each class), but it also gives examples on how to perform our own analysis on various types of problems. As such, I give this section a 7/10.
