Introduction to Algorithms - PowerPoint PPT Presentation

1 / 18
About This Presentation
Title:

Introduction to Algorithms

Description:

Any algorithm that creates the desired relationship between ... We will take a short break from algorithms and chapter 2 to work on math concepts in chapter 3. ... – PowerPoint PPT presentation

Number of Views:1072
Avg rating:3.0/5.0
Slides: 19
Provided by: michae419
Category:

less

Transcript and Presenter's Notes

Title: Introduction to Algorithms


1
Introduction to Algorithms
Book by Thomas H. Cormen Charles E.
Leiserson Ronald L. Rivest and Clifford Stein
Powerpoint by Michael Block
2
Chapter 1
3
Algorithms
4
Algorithms - Basic Definition
  • A set procedure to process information.
  • A correct algorithm is defined as
  • Any algorithm that creates the desired
    relationship between the input and output values.

5
Algorithms - Examples - Sorting Algorithms
Insertion Sort
Merge Sort
Grouped
Original Input
Organize
Find the first incorrect placement
Sort the next incorrect placement
Final sorted input
Final sorted input
This step takes a lot longer than the others
Insertion sort is efficient when sorting small
amounts of numbers.
Merge sort is efficient with large amounts of
numbers.
6
Data Structures
7
Data Structures - Basic Definition
  • A means of storing data.
  • Does not have to be organized.
  • Usually created for a specific purpose or
    situation.
  • Use the data structure best suited for your
    problem to allow your algorithm to be as
    efficient as possible.

8
NP-Complete Problems
9
NP-Complete Problems - Basic Definition
  • A problem without an efficient algorithm.
  • If an efficient algorithm exists for one it
    works for all.

10
Efficiency
11
Efficiency - Basic Definition
  • Efficiency determines how well designed an
    algorithm is.
  • Efficiency does not have to be measured in time.
  • Efficiency can be found by creating a formula of
    each part in the algorithm based on a variable
    and solving for that variable.

12
And now for something completely different...
We will take a short break from algorithms and
chapter 2 to work on math concepts in chapter 3.
13
Chapter 3
14
All Greek to me -
- Pronounced theta
  • Used in graphing curves and parabolas to create
    an upper and lower bound.

Asymptotic upper bounds
Original function
Starting point for the asymptotic bind
Asymptotic lower bounds
15
All Greek to me -
Because the base of both sides is (n) the
equation is asymptotically tight bound. The
coeficients of n do not matter as long as the
term stays basically the same.
Data being tested
Theta creates an upper and lower bounds so that
the data stays within an acceptable range.
16
All Greek to me -
Asymptotically tight bound
Not asymptotically tight bound
Because n is on both sides of the equation.
Because one side contains n² and the other
contains n¹.
17
All Greek to me - O
O - Pronounced big-oh
  • Used in graphing curves and parabolas to create
    an upper bound.

Asymptotic upper bounds
Starting point for the asymptotic bind
Original function
18
All Greek to me - O
Write a Comment
User Comments (0)
About PowerShow.com