cs 4 56101
play

CS 4/56101 Design and Analysis of Alg lgorithms Fall ll 2020 - PowerPoint PPT Presentation

CS 4/56101 Design and Analysis of Alg lgorithms Fall ll 2020 Website and Contact Course Website: http://www.cs.kent.edu/~aalbaghd/DAAFall20 Important information Slides Announcements Instructor: Ahmed Al-Baghdadi


  1. CS 4/56101 Design and Analysis of Alg lgorithms Fall ll 2020

  2. Website and Contact • Course Website: • http://www.cs.kent.edu/~aalbaghd/DAAFall20 • Important information • Slides • Announcements • Instructor: • Ahmed Al-Baghdadi • Email: aalbaghd@kent.edu • Office hours: 5:00p.m. to 6:00p.m. Tuesday and Thursday

  3. Learning objectives • Advanced data structures and their analysis • To think algorithmically like a "real" computer scientist • Different techniques and methods for designing efficient algorithms for solving computational problems • Students will develop • the ability to design efficient algorithms • the ability to prove correctness and evaluate efficiency of algorithms

  4. Course Goals • Study important data structures and algorithmic techniques not normally covered in CS 23001 • Develop ability to design efficient algorithms • Develop ability to prove correctness and evaluate efficiency of algorithms • **The main goal of the course is to learn to think algorithmically like a ``real'' computer scientist

  5. Topics will include: • Computational Model and Runtime Analysis • Binary Search • Insertion, Merge, and Quicksort • Heaps and Priority Queues • Linear Time Sorting • Red-Black, AVL, and B-Trees • Hash Tables • Graphs • Basic Algorithms • DAGs • Minimum Spanning Tree • Shortest Path (Dijkstra)

  6. Textbook • Introduction to Algorithms, by Cormen et al. 3rd edition, MIT Press, 2009 Primary source for this class.

  7. Other Books • Algorithm Design: Foundations, Analysis, and Internet Examples, by Michael T. Goodrich and Roberto Tamassia, 1st edition, Wiley, 2001 • The Algorithm Design Manual, by Steven S. Skiena 2nd edition, Springer, 2008

  8. Note • You do not need (to buy) a textbook. These are recommendations if you are looking for a textbook to study.

  9. Course Requirements • Homework 35% • Download from the course website • Deadline will be announced on the course website • Midterm Exam 30% • (Week 7 (Oct. 6), in class time via Blackboard) • Final Exam 30% • (Will be decided between Dec. 14 Dec. 20) • Attendance 5% • ** NOTE: Exam dates and deadlines are tentative. Exact dates will be announced in class!!!

  10. Class Policies • Late Policy • Homework must be sent submitted by Blackboard by the due date shown on the course website • Unexcused late homework is not accepted • Missed exams and missed homework are only excused if absence was essential and can be fully documented. • Registration Requirements • Sept. 2nd: Official registration deadline • Sept. 9th: Last day to drop before grade of "W" is assigned is • Nov. 11th: Last day to withdraw

  11. Homework and Collaboration • You will need to devote a considerable amount of time to homework • You may discuss the homework with other students, but you must write your solutions independently • If you obtain a solution to a homework problem through research (e.g., from books or journals), you are expected to acknowledge your sources in your write up and also to write up your solution independently

  12. Milestone for successful completion of the course • Attend the classes regularly • Perform the homework thoroughly and independently • Read a head • Read the book carefully and several times • Ask Questions

  13. What is an algorithm? • Algorithm • a set of steps to accomplish a task

  14. What is an algorithm? • Algorithm • a set of steps to accomplish a task • Example: • Making Pizza

  15. What is an algorithm? • Algorithm in Computer Science • an algorithm is a set of steps for a computer program to accomplish a task • Examples of CS Algorithms • Search algorithm

  16. What is an algorithm? • Algorithm in Computer Science • an algorithm is a set of steps for a computer program to accomplish a task • Examples of CS Algorithms • Search algorithm (Find the Maximum) High-level description: 1.If there are no numbers in the set then there is no highest number. 2.Assume the first number in the set is the largest number in the set. 3.For each remaining number in the set: if this number is larger than the current largest number, consider this number to be the largest number in the set. 4.When there are no numbers left in the set to iterate over, consider the current largest number to be the largest number of the set.

  17. What is an algorithm? • Algorithm in Computer Science • an algorithm is a set of steps for a computer program to accomplish a task • Examples of CS Algorithms • Search algorithm High-level description: 1.If there are no numbers in the set then there is no highest Algorithm LargestNumber number. Input: A list of numbers L . Output: The largest number in the list L . 2.Assume the first number in the set is the largest number in the if L.size = 0 set. return null 3.For each remaining number in the set: if this number is larger largest ← L [0] than the current largest number, consider this number to be the for each item in L , do largest number in the set. if item > largest , 4.When there are no numbers left in the set to iterate over, then largest ← item consider the current largest number to be the largest number of return largest the set.

  18. What is an algorithm? • Algorithm in Computer Science • an algorithm is a set of steps for a computer program to accomplish a task • Examples of CS Algorithms • Path Finding (Google Maps)

  19. What is an algorithm? • Algorithm in Computer Science • an algorithm is a set of steps for a computer program to accomplish a task • Examples of CS Algorithms • Path Finding (Google Maps)

  20. What is an algorithm? • Algorithm in Computer Science • an algorithm is a set of steps for a computer program to accomplish a task • Examples of CS Algorithms • Path Finding (Google Maps)

  21. What makes a good algorithm? • The two most important criteria • will it solve the problem? • produce the desired output? • prove that our algorithms are correct • will it solve the problem efficiently? • 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.

  22. Problem Example • You are given two integer arrays A and B. Is there an integer i which is in both arrays?

  23. Problem Example • You are given two integer arrays A and B. Is there an integer i which is in both arrays? • First Algorithm 1- For Each a ∈ A For Each b ∈ B 2- 3- If a = b Then Return “Yes” 4- 5- Return “No”

  24. Problem Example • You are given two integer arrays A and B. Is there an integer i which is in both arrays? • Second Algorithm 1 Sort A and B. 2 Set i := 0 and j := 0. 3 While i < |A| and j < |B| 4 If A[i] = B[j] Then Return “Yes” 5 6 Else If A[i] < B[j] Then 7 Set i := i + 1. 8 Else If A[i] > B[j] Then 9 Set j := j + 1. 10 Return “No”

  25. Problem Example • Which algorithm is better and why? 1- For Each a ∈ A 1 Sort A and B. 2- For Each b ∈ B 2 Set i := 0 and j := 0. 3- If a = b 3 While i < |A| and j < |B| Then Return “Yes” 4- 4 If A[i] = B[j] Then 5- Return “No” Return “Yes” 5 6 Else If A[i] < B[j] Then 7 Set i := i + 1. 8 Else If A[i] > B[j] Then 9 Set j := j + 1. 10 Return “No”

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend