Design and Analysis of Algorithms
This Class
Website and Contact Website ◮ www.cs.kent.edu/ ∼ aleitert/fall15/ ◮ Important information ◮ Slides ◮ Announcements Email ◮ aleitert@cs.kent.edu Feedback ◮ First time teaching this class. ◮ Feedback is appreciated. 3 / 19
Primary Textbook Introduction to Algorithms , T H O M A S H. C O R M E N by Cormen et al. C H A R L E S E. L E I S E R S O N R O N A L D L. R I V E S T 3rd edition, MIT Press, 2009 C L I F F O R D S T E I N Primary source for this class. I N T R O D U C T I O N T O A L G O R I T H M S T H I R D E D I T I O N 4 / 19
Other Textbooks The Algorithm Design Manual , by Steven S. Skiena 2nd edition, Springer, 2008 PDF-Version available for free at Springer Link 5 / 19
Other Textbooks Algorithms, 4th Edition , by Robert Sedgewick and Kevin Wayne 4th edition, Addison-Wesley Professional, 2011 Algorithm Design: Foundations, Analysis, and Internet Examples , by Michael T. Goodrich and Roberto Tamassia, 1st edition, Wiley, 2001 6 / 19
Clarification Clarification You do not need (to buy) a textbook. These are recommendations if you are looking for a textbook to study. 7 / 19
Course Requirements Exam 1 25 % Oct. 8, during class Exam 2 25 % Oct. 29, during class Exam 3 25 % Nov. 24, during class Final Exam 25 % Thursday, December 17, 7:45 – 10:00 a.m. HW (normal) 0 % HW (bonus) 10 % (Dates may change.) Exams ◮ closed book examination ◮ one handwritten sheet ( one side ) allowed 8 / 19
Homework Normal Homework ◮ Will not be graded. ◮ Good preparation for exams. Bonus Homework ◮ Mostly implementation problems ◮ Helpful to understand details of algorithms ◮ Up to 10 % to your final grade. 9 / 19
Office Hours Tuesday and Thursday, 2.00 – 3.00 p.m. Room 352, Math and CS Building “I have class during office hours” ◮ Send me an email. We will find some time. ◮ Please tell me directly when you have time to meet. 10 / 19
Algorithms
Algorithm Question What is an algorithm ? 12 / 19
Algorithm Question What is an algorithm ? Wikipedia An algorithm is a self-contained step-by-step set of operations to be performed. [...] An algorithm is an effective method that can be expressed within a finite amount of space and time [...] for calculating a function. Starting from an initial state and initial input, the instructions describe a computation that [...] proceeds through a finite number of well-defined successive states, eventually producing “output” and terminating at a final ending state. 12 / 19
Algorithm Algorithm An algorithm is a finite and well-defined set of operations which compute an output for a (possible empty) input. Input Algorithm Output 13 / 19
Properties of Algorithms Correctness ◮ Will it produce the desired output? ◮ We will prove that our algorithms are correct. Efficiency ◮ How fast is the algorithm? ◮ How much resources does it need? ◮ Is there a faster algorithm? Having one of both properties is (usually) easy. However, having both is the goal. 14 / 19
Example
Problem Finding doubles You have given two integer arrays A and B . Is there an integer i which is in both arrays? 16 / 19
Algorithm 1 1 For Each a ∈ A For Each b ∈ B 2 If a = b Then 3 Return “Yes” 4 5 Return “No” 17 / 19
Algorithm 2 1 Sort A and B . 2 Set i := 0 and j := 0 . 3 While i < | A | and j < | B | If A [ i ] = B [ j ] Then 4 Return “Yes” 5 Else If A [ i ] < B [ j ] Then 6 Set i := i + 1 . 7 Else If A [ i ] > B [ j ] Then 8 Set j := j + 1 . 9 10 Return “No” 18 / 19
Question Question Which algorithm is better and why? 19 / 19
Recommend
More recommend