Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Algorithms

Similar presentations


Presentation on theme: "Introduction to Algorithms"— Presentation transcript:

1 Introduction to Algorithms
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 = 20,000 secs ≈ 5.56 hours 2 (106)2 instrs
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) 2 (106)2 instrs = 20,000 secs ≈ 5.56 hours 108 instruction/sec 50(106lg 106) instrs = 1,000 secs ≈ minutes 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)
Jeff Chastine


Download ppt "Introduction to Algorithms"

Similar presentations


Ads by Google