COMSATS Institute of Information Technology, Lahore M. A. Jinnah Campus, Defence Road, Off Raiwind Road, Lahore Tel: 042-5321090, 042-9203101, Fax: 042-9203100 Semester Course Plan and Course Outline Design and Analysis of Algorithms Study Program Semester Course Code Course Title Instructor Credit Hour Pre-Requisite(s) Total Lectures Lecture Duration BCS Fall 2012 CSC-201 Design and Analysis of Algorithms Dr. Muhammad Umair 3 Data Structure, Discrete Mathematics, Statistics 30 90 minutes Basic Information Course Statement It is an introductory course to the design and analysis of algorithms. It covers mainly asymptotic analysis of time complexity, Proofs of correctness, Algorithms and advanced data structures for searching and sorting lists, graph algorithms, numeric algorithms, and string algorithms. Course Objectives This course focuses on the complexity and correctness of algorithms: big oh, big omega, and big theta notations, recurrence relations and their solutions, and worst, average and amortized analysis of algorithms with examples. Basic and advanced data structures for searching, sorting, and graph algorithms. This course places emphasis on complexity analysis, sorting, graph theory and problem-solving strategies. Comparison of various sorting and graph algorithms, with focus on complexity and space versus time trade-offs is made. A special effort is made to formulate and design algorithms and use of approximate algorithms where the problem cannot be solved by an exact algorithm COMSATS Institute of Information Technology, Lahore M. A. Jinnah Campus, Defence Road, Off Raiwind Road, Lahore Tel: 042-5321090, 042-9203101, Fax: 042-9203100 Learning Outcome On successful completion of this course unit students will: 1. Understand the general notion of complexity classes, P and NP, completeness and hardness, and the relationships between classes by reduction. You will also have seen how to show tasks are NP-complete 2. Be able to develop, and reason about the correctness and performance, of algorithms for string searching and for calculating over graphs 3. Have studied a range of distributed and probabilistic algorithms, understand the key issues involved, and be able to use distributed and probabilistic techniques to develop algorithms. COMSATS Institute of Information Technology, Lahore M. A. Jinnah Campus, Defence Road, Off Raiwind Road, Lahore Tel: 042-5321090, 042-9203101, Fax: 042-9203100 Course Outline Design and Analysis of Algorithms Week # 1 2 3 4 5 Topics/Contents Basic Mathematic & Introduction to Algorithms: Reading Material, What is an Algorithm? Its role in computing, Its Implementation Domain, Data structure & Techniques, Hard Problems, Algorithm as Technology, Efficiency, Algorithms & other technologies. Algorithm Analysis: Introduction to Algorithm analysis, Bench marks for analysis, Selection Sort and its analysis, Complexity Classes, Big – O Notation, Experimental and mathematical proof for Selection Sort. Analyzing the Algorithms, RAM model, Analysis of Insertion Sort, Worst & Average Case analysis, Order of Growth. Growth of Functions: Asymptotic notations, - notation, O – notation, - notation, Asymptotic notation in equations and inequalities, o – notation, - notation, comparison of functions, Standard notations & common function Designing of Algorithms: Loop Invariants and the correctness, Incremental Approach, Divide and conquer approach, Its use in Merge Sort, Analysis of Merge Sort, Recurrences, Its Technicalities, The Substitution Method, Subtleties, Avoiding pitfalls, Changing Variables. Designing of Algorithms: The Recursion – Tree Method, Its implementation and use. Different cases of Recursion Tree Method. The Master Method, The Master Theorem & its use, Revision of Course for First Sessional First Sessional 6 7&8 9&10 11 Application of Analysis & Design Techniques: Heaps, Heap Sort, Maintaining Heap Property, Building a Heap, The Heap Sort Algorithm, Priority Queues Application of Analysis & Design Techniques: Sorting and order Statistics, Structure of data, Why sorting is used? Different Sorting Techniques, Quick sort, Description of Quick Sort, Performance of Quick Sort, worst, average & best cases, Analysis of quick sort, Worst-case analysis. Application of Analysis & Design Techniques: Sorting in Linear Time, Lower Bounds for sorting, Decision – tree model, Tracking and implementation of Counting Sort, Its analysis, tracking and implementation of Radix Sort & Bucket Sort with their analysis. Hash Table & Hashing: Hashing, Direct – address table, Hash Tables, Collision, Resolution by chaining, and Analysis of hashing with chaining, Hash functions, The division method, and Multiplication method, Universal Hashing, Designing a universal class of hashing functions. Revision of Course for Second Sessional Second Sessional 12 13 Hashing & Binary Search Tree: Open Addressing, Linear probing, Quadratic probing, Double Hashing, Analysis of open – address hashing. What is Binary Search Tree? Querying a Binary Search Tree, Insertion and Deletion of Binary Search Tree. Dynamic Programming: Assembly – line scheduling, fastest way through the factory, recursive solution, computation of the fastest time, construction of fastest way, Matrix – chain Multiplication, optimal parenthesization, recursive solution, optimal cost calculation, construction of optimal solution. COMSATS Institute of Information Technology, Lahore M. A. Jinnah Campus, Defence Road, Off Raiwind Road, Lahore Tel: 042-5321090, 042-9203101, Fax: 042-9203100 Week # 14,15 16,17 Topics/Contents Dynamic Programming: Basic elements of dynamic programming, Longest Common Subsequence (LCS), Optimal Binary Search tree, Analysis & construction of optimal solution. Greedy Algorithms: Activity – selection problem, recursive & iterative greedy algorithm, Elements of the greedy strategy, greedy choice property, Optimal substructure, greedy versus dynamic programming. Huffman Codes, prefix code, Construction of Huffman code, and Correctness of Huffman’s algorithm. Recommended Text Book(s) Sr. No. 1 2 3 Book Introduction to Algorithms Algprithms Author(s) Edition Thomas H. Cormen Robert Sedgewick 2nd 2nd Supplementary Reading(s) Sr. No. 1 2 Book Author(s) Compared to What? An Introduction to the Analysis of Algorithms The Design and Analysis of Computer Algorithms G.J.E Rawlins Alfred V. Aho Edition