This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Lecture Notes AMCS/CS 260 Design and Analysis of Algorithms Mikhail Moshkov Division of Mathematical and Computer Sciences and Engineering King Abdullah University of Science and Technology Spring 2010 Preface This course is devoted to the consideration of some approaches to design and analysis of algorithms. Each algorithm A transforms input data x into output data y . The run of A on the input data x can be characterized by some complexity measure L A ( x ) (the number of steps of the algorithm, the size of used memory). The understanding of the behavior of L A ( x ) for different x is a very compli cated problem. Therefore we consider the behavior of L A ( x ) in the worst case or the behavior of L A ( x ) in the average case. We fix some natural parameter n which characterizes the complexity of the input x representation, and we study maximum value of L A ( x ) or average value of L A ( x ) among all inputs x for which the complexity of x is equal to n (or is at most n ). So instead of L A ( x ) we study a function L A ( n ) which characterized the worst or averagecase complexity. For such functions we are able to obtain interesting and useful results. In this course, we study only time complexity of algorithms. We concentrate on algorithms, but from time to time we discuss also some useful data structures. The course of the same name read by Tim Roughgarden in Stanford Univer sity influenced essentially to the structure of our course. These lecture notes are based (including almost copying of some fragments) on the following four textbooks – V. Alekseev, Introduction to Algorithm Complexity, Moscow State Univer sity, 2002 (in Russian), – T. Cormen, C. Leiserson, R. Rivest, and C. Stein, Introduction to Algorithms (2nd Edition), McGraw Hill, 2002, – S. Dasgupta, C. Papadimitriou, and U. Vazirani, Algorithms, McGrawHill, 2006, – J. Kleinberg and E. Tardos, Algorithm Design, AddisonWesley, 2005, and on lectures read by the author in Nizhni Novgorod University, Russia and Silesian University, Poland. 1 Introduction (Search and Sorting) In this section we consider problems of search and sorting, O,Ω,Θ,o,ω notation, and the notion of 23 trees. 1.1 Search in Ordered Array Let we have an ordered array of elements from some linearly ordered set: a 1 < a 2 < ... < a n . The input of the algorithm of search is an element a ∈ { a 1 ,...,a n } . The output of the algorithm is a number j ∈ { 1 ,...,n } such that a = a j . Each step is a comparison of a with some a i , i ∈ { 1 ,...,n } . We will consider only deterministic algorithms. Each algorithm can be repre sented in the form of a decision tree in which terminal nodes (leaves) are labeled with elements from { a 1 ,...,a n } . These are results of the algorithm work. Each nonterminal node is labeled also with an element a i from { a 1 ,...,a n } . In this node we compare a and a i . Exactly two edges issue from each nonterminal node....
View
Full
Document
 Spring '10
 DUNNO
 Algorithms, Machine Learning

Click to edit the document details