|
CS 361: Algorithms and Data Structures |
|
Assignments will be collected at the beginning of the class period. Please bring a hardcopy to turn in. Your assignment can be hand-written or typed.
|
Textbook questions [30 points]
|
|
Additional question [20 points] In this course, we will be studying many different types of algorithms. It is important that you understand how the algorithms we cover in class fit within the larger field of Algorithms. To this end, consider the following high-level classification scheme for algorithms:
Note the difference between approximation algorithms and inductive algorithms. Approximation algorithms produce a nearly correct output for all inputs whereas inductive algorithms produce a correct output for nearly all inputs. All of the algorithms we cover in this class will be exact algorithms! Selection sort is an example of an exact algorithm. We showed, using loop invariants, that selection sort correctly sorts an array of numbers. At the end of the semester, we will learn about NP-complete problems which (informally) are problems that take too long to solve optimally. Many algorithms for NP-complete problems are approximation algorithms: it may take too long to find an optimal solution, but finding a nearly-optimal solution is quite feasible. Finally, there are inductive algorithms. This question asks you to apply what you've learned so far about exact algorithms (i.e. the characteristics of an algorithm, input size, running time) to inductive algorithms. Consider the following problem: Given two newspaper articles, determine whether the articles discuss the same news event. The input is the text of both articles. The output is a yes/no decision.
|