1 / 12

The Role of Algorithms

The Role of Algorithms. Introduction to Algorithms. Algorithms. Studying algorithms is about studying efficiency How fast does it run? Can I make it run faster?. Algorithms. An algorithm is any well-defined computational procedure that takes some input and produces output

beaupre
Download Presentation

The Role 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. The Role of Algorithms Introduction to Algorithms Jeff Chastine

  2. Algorithms • Studying algorithms is about studying efficiency • How fast does it run? • Can I make it run faster? Jeff Chastine

  3. Algorithms • An algorithm is any well-defined computational procedure that takes some input and produces output • A sequence of steps • An algorithm is correct if for all input, it halts with the correct output • We say that a correct algorithm solves the computational problem • An incorrect algorithm may not halt! Jeff Chastine

  4. Example: Sorting Problem • Input: A sequence of n numbers<a1, a2, …, an> • Output: A permutation <a'1, a'2, …, a'n> of the original such that a'1 ≤ a'2 ≤ …≤ a'n • Sorting is fundamental to computer science, so we’ll be studying several different solutions to it Jeff Chastine

  5. The Challenge • Suppose we have 1 million numbers to sort • Your computer executes 100 million ips • Mine executes 1 million ips • You have optimized compiler (take hit of 2) • I have crummy compiler (take hit of 50) • You use insertion sort (n2), I use merge sort (n log n) = 20,000 secs ≈5.56 hours 2 (106)2 instrs 108 instruction/sec = 1,000 secs ≈16.67 minutes 50(106lg 106) instrs 106 instruction/sec Jeff Chastine

  6. I WIN! Jeff Chastine

  7. Problems to Think About… • Searching large amounts of information • Most efficient path from A to B (how many routes are there?) • Find a convex hull that contains all points • Travel to a series of points and return home • Best way to schedule classes • Impossible to solve problems? Jeff Chastine

  8. What you’ll be studying • The Design and Analysis of Algorithms • Growth of Functions • Recurrences • Heapsort, Quicksort, Counting Sort… • Medians and Order Statistics • Elementary Data Structures • Hashing Jeff Chastine

  9. What you’ll be studying • Binary Search Trees • Dynamic Programming • Greedy Algorithms • Amortized Analysis • Elementary Graph Algorithms Jeff Chastine

  10. What you’ll be studying • Minimum Spanning Trees • Single-Source Shortest Paths • All-Pairs Shortest Paths • NP-Completeness • Approximation Algorithms Jeff Chastine

  11. A Most Excellent Quote “Having a solid base of algorithmic knowledge and technique is one characteristic that separates the truly skilled programmers from the novices.” Jeff Chastine

  12. The Proof(and why you should pay attention) • http://www.geeksforgeeks.org/ Jeff Chastine

More Related