1 / 23

CS 615: Design & Analysis of Algorithms

CS 615: Design & Analysis of Algorithms. Chapter 1: Introduction , Algorithmic Notation and Flowcharts. Course Content. Introduction , Algorithmic Notation and Flowcharts (Brassard & Bratley , Chap . 3) Efficiency of Algorithms (Brassard & Bratley , Chap 2)

jacobsona
Download Presentation

CS 615: Design & Analysis of Algorithms

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS 615: Design & Analysis of Algorithms Chapter 1: Introduction, Algorithmic Notation and Flowcharts

  2. Course Content • Introduction, Algorithmic Notation and Flowcharts (Brassard & Bratley, Chap. 3) • Efficiency of Algorithms (Brassard & Bratley,Chap 2) • Basic Data Structures (Brassard & Bratley,Chap. 5) • Sorting (Weiss, Chap. 7) • Searching (Brassard & Bratley, Chap. 9) • Graph Algorithms (Weiss, Chap. 9) • Randomized Algorithms (Weiss, Chap. 10) • String Searching (Sedgewick, Chap. 19) • NP Completeness (Sedgewick, Chap. 40) CS 615 Design & Analysis of Algorithms

  3. Content • Text books, • Lectures • Assessments • Asymptotic Notation • Notation for “the order of” • Maximum Rule • Flowcharts • Basic Flowchart Constructions CS 615 Design & Analysis of Algorithms

  4. Instructor • Yusuf Altunel • Email: y.altunel@iku.edu.tr • Web: http://web.iku.edu.tr/~yaltunel • Tel: (212) 498 42 10 CS 615 Design & Analysis of Algorithms

  5. Text Books • Main Resources • Data Structures and Algorithm Analysis in C, 2nd Edition; Mark Allen Weiss; Addison Wesley Longman, 1997 • Fundamentals of Algorithmics; Gilles Brassard & Paul Bratley; Prentice-Hall, 1996. • Data Structures, Algorithms & Software Principles, Thomas A. Standish, Addison Wesley, 1995. • Other Resources • Algorithms, Richard Johnsonbaugh and Marcus Schaefer, Pearson, 2004, ISBN 0-02-360692-4. http://condor.depaul.edu/~rjohnson/algorithm/index.html • Algorithm Design: Foundations, Analysis, and Internet Examples; Michael T. Goodrich & Roberto Tamassia; Wiley, 2002, ISBN 978-0-471-38365-9. http://ww3.algorithmdesign.net/ • Algorithms, Robert Sedgewick, Addison-Wesley 1983, e-book. CS 615 Design & Analysis of Algorithms

  6. Lectures • Courses and labs CS 615 Design & Analysis of Algorithms

  7. Follow up the course • Use the web page of the course http://web.iku.edu.tr/~yaltunel/Spring2005/CS615 • Use the email group of the course • Send an empty email to subscribe: CS_615-subscribe@yahoogroups.com • To send a message: CS_615@yahoogroups.com • To access on web: http://groups.yahoo.com/group/CS_615 CS 615 Design & Analysis of Algorithms

  8. Assessment • Participation • %10 • Project • %30 • MidTerm • %30 • Final • %40 • Bonus • Grading: %110 • %10 Bonus • Please take care of the rules and regulations of the University. • Otherwise you might be reported to the faculty, as well as lose all bonus options of this course. CS 615 Design & Analysis of Algorithms

  9. Project • A real world application with dynamically constructed graph should be implemented until the end of the semester! • Details will be announced later! CS 615 Design & Analysis of Algorithms

  10. Algorithmic Notation and Flowcharts (Brassard & BratleyChp: Chapter 3) CS 615 Design & Analysis of Algorithms

  11. Asymptotatic Notation • Used to express • The time taken by an algorithm • Within a multiplicative constant • Permits • Simplification in measuring other tangible things • Deals with • The behavior of functions in the limits • For sufficiently large parameters • An asymptotically superior algorithm is • very often preferable CS 615 Design & Analysis of Algorithms

  12. Notation for “the order of” • f:NR0 be an arbitrary function • from the natural numbers • to the nonnegative numbers • The mathematical symbol order of is • denoted by O(f(n)) • the set of all functions t: NR0 such that • t(n) cf(n) for all nn0 • O(f(n))={t: NR0 |(cR+)(nN)[t(n) cf(n)]} • Examples • f(n)=n3-3n2-n-8  O(n3) • f(n)= n3 O(n3) • Maximum Rule: • Let f,g: NR0 be two arbitrary functions • O(f(n),g(n))=O(max(f(n),g(n))) CS 615 Design & Analysis of Algorithms

  13. Example for Maximum Rule • An algorithm that proceeds in three steps: • Initialization • Take time in O(n2) • Processing • Take time in O(n3) • Finalization • Take time in O(nlogn) • The complete algorithm takes time in • O(n2 + n3 + nlogn) • = O(max(n2,n3,nlogn)) • =O(n3) CS 615 Design & Analysis of Algorithms

  14. Results of Maximum Rule • If t(n) is a complicated function • the most significant term of t(n) gives • the order of function discarding its coefficient • Example: • f(n)= 12n3- 5n2 + logn + 36 • O(f(n))=O(n3) • f(n)= 999999n94 - 345n35 + 1 • O(f(n))=O(n94) CS 615 Design & Analysis of Algorithms

  15. Scale of Strength for O-Notation • the relationship between order of functions • O(1) < O(logn) < O(n) < O(nlogn) < O(n2) < O(n3) < O(2n) < O(10n) Higher in order More efficient CS 615 Design & Analysis of Algorithms

  16. Examples • What is the order of 18nlog2n + 19n + 3 • =O(18nlog2n + 19n + 3) • =O(max (nlogn, n, 3) ) • =O(nlogn) • What is the order of n4 + 2n + 3nlogn + 3 • =O(n4 + 2n + 3nlogn + 3) • =O(max (n4, 2n, nlogn , 3) ) • =O(2n) CS 615 Design & Analysis of Algorithms

  17. Flowcharts Process Data Decision Process Display Terminator CS 615 Design & Analysis of Algorithms

  18. Basic Flowchart Constructions F T First Task Cond Else Part Then Part F Next Task Cond T Sequence If Then Else Repeat-Until CS 615 Design & Analysis of Algorithms

  19. Basic Flowchart Constructions T Cond1 F Cond F T Cond2 T ... ... T Condn F While-Do Selection (Case) CS 615 Design & Analysis of Algorithms

  20. Basic Flowchart Constructions initialization F Cond T for (i=1; i<n; i++) {..} for (<initialization>; <condition>; <post statement>) <statement> statement post statement For statement CS 615 Design & Analysis of Algorithms

  21. Data Flow: Example Start Task1 if Cond1 then if Cond2 then Task2 else Task3 else repeat Task4 until Cond3 End Start Task1 T Cond1 F T F Cond2 Task4 Task2 Task3 Cond3 F T End CS 615 Design & Analysis of Algorithms

  22. Example find Maximum Start max= infinitive Start max= minimum do get a number if (max<number) then max = number while more numbers show max End get a number T F max<number max=number T T More numbers? F Show max end CS 615 Design & Analysis of Algorithms

  23. End of Chapter 1Introduction, Algorithmic Notation and Flowcharts CS 615 Design & Analysis of Algorithms

More Related