Intro to Computer Algorithms Lecture 3 - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

Intro to Computer Algorithms Lecture 3

Description:

... to Computer Algorithms. Lecture 3. Phillip G. Bradford. Computer ... Big-O, Omega, Theta. Little O and limits. L'Hoptial's rule. Examples. Orders of Magnitude ... – PowerPoint PPT presentation

Number of Views:21
Avg rating:3.0/5.0
Slides: 15
Provided by: pgb8
Category:

less

Transcript and Presenter's Notes

Title: Intro to Computer Algorithms Lecture 3


1
Intro to Computer Algorithms Lecture 3
  • Phillip G. Bradford
  • Computer Science
  • University of Alabama

2
Announcements
  • Industrial Colloquium Series
  • TODAY at 500pm in EE 119
  • Herschel Chandler presents
  • Being an Independent Computer Consultant

3
Announcements
  • Colloquium
  • Establishing Wireless Conference Calls Under
    Delay Constraints
  • By Dr. Greg Malewicz
  • Wednesday, Sept. 3
  • 1100 am in HO108

4
Lecture Outline
  • New Homework Assignment
  • Review last lecture
  • Asymptotic Notation
  • Recurrences

5
Asymptotic Notation
  • Big-O, Omega, Theta
  • Little O and limits
  • LHoptials rule
  • Examples

6
Orders of MagnitudeFrom Levitins Book
7
LHopitals Rule
  • Requires indeterminate forms
  • Lim f(n)/g(n) ? 0/0
  • Lim f(n)/g(n) ? infinity/infinity
  • If indeterminate form, then
  • lim f(n)/g(n) lim f(n)/g(n)
  • Examples

8
An Example Hard Problem
  • Towers of Hanoi
  • Start Configuration

A
B
C
9
An Example Hard Problem
  • Rules
  • Move Only One Disk at a Time!
  • Smaller Disks Must Be on Top!
  • Final Configuration Desired

A
B
C
10
An Example Hard Problem
  • What Algorithm Can We Use?

A
B
C
A
B
C
A
B
C
11
An Example Hard Problem
  • More of the algorithm

A
B
C
A
B
C
A
B
C
12
An Example Hard Problem
  • Finally

A
B
C
13
An Example Hard Problem
  • What about 4 Disks?

A
B
C
A
B
C
How Much MORE work than for 3 Disks?
14
How expensive is this?
  • T(n) 2T(n-1) 1, ngt 1
  • T(1) 1.
  • Closed form?
  • Claim T(n) 2n -1
  • How can we show this?
Write a Comment
User Comments (0)
About PowerShow.com