Advanced Programming I and the Role of Algorithms - PowerPoint PPT Presentation

1 / 10
About This Presentation
Title:

Advanced Programming I and the Role of Algorithms

Description:

Elementary Data Structures. Hashing. What you'll be studying. Binary Search Trees. Red-Black Trees ... technique is one characteristic that separates the truly ... – PowerPoint PPT presentation

Number of Views:19
Avg rating:3.0/5.0
Slides: 11
Provided by: jeffch8
Category:

less

Transcript and Presenter's Notes

Title: Advanced Programming I and the Role of Algorithms


1
Advanced Programming Iand the Role of Algorithms
  • Introduction to Algorithms

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

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!

4
Example Sorting Problem
  • Input A sequence of n numberslta1, a2, , angt
  • Output A permutation lta'1, a'2, , a'ngt of the
    original such that a'1 a'2 a'n
  • Sorting is fundamental to computer science, so
    well be studying several different solutions to
    it

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
6
I WIN!
7
What youll be studying
  • The Design and Analysis of Algorithms
  • Growth of Functions
  • Recurrences
  • Heapsort, Quicksort, Counting Sort
  • Medians and Order Statistics
  • Elementary Data Structures
  • Hashing

8
What youll be studying
  • Binary Search Trees
  • Red-Black Trees
  • Dynamic Programming
  • Greedy Algorithms
  • Amortized Analysis
  • B-Trees
  • Elementary Graph Algorithms

9
What youll be studying
  • Minimum Spanning Trees
  • Single-Source Shortest Paths
  • All-Pairs Shortest Paths
  • NP-Completeness
  • Approximation Algorithms

10
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.
Write a Comment
User Comments (0)
About PowerShow.com