Lect01
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Lect01

on

  • 366 views

daa slide lecturer 01

daa slide lecturer 01

Statistics

Views

Total Views
366
Views on SlideShare
366
Embed Views
0

Actions

Likes
0
Downloads
1
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Lect01 Presentation Transcript

  • 1. Analysis and Design of Algorithms
    • An algorithm is a method of solving problem (on a computer)
    • Problem example:
      • given a set of points on the plane
      • find the closest pair
    • Algorithm:
      • find distance between all pairs
    • Can we do it faster?
  • 2. Combinatorial Problems
    • Closest pair
      • O(n^2) algorithm
    • TSP
      • O(n!) algorithm
      • too slow
      • difficult problem
  • 3. Course Overview
    • General algorithmic methods
      • divide and conquer, greedy algorithms, dynamic programming
    • Data structures
      • hashing, priority queues, binary search trees, binomial heaps
    • Combinatorial problems
      • MST, TSP, Vertex/Set Cover, Matrix
    • Computational Complexity
      • NP-completeness, reducibility, approximation
    • Cormen-Leiserson-Rivest
    • Introduction to Algorithms
  • 4. Grading
    • Home work 1/3
      • problems from Cormen ...
      • two programming assignments
    • 4 Quizes 1/3
    • 4520 Final 1/3
    • 6520 Project 1/3
  • 5. Home Work
    • Problem sets
      • weekly
      • handed in/out Tuesdays (usually)
      • Extra-credit problems!
    • Due next Tuesday
      • 1.4-1 p.17 / 1.2-2 p.13
      • 1.4-2 p.17 / 1.2-2 p.13
  • 6. Sorting
    • Input: sequence of numbers
    • Output: a sorted sequence
    • Insertion-Sort
      • for j = 2 to n do
        • current=A[j]
        • i = j - 1
        • while i > 0 & A[i] > current do
          • A[i + 1] = A[i]
          • i = i - 1
        • A[i + 1] = current
  • 7. How it works
    • Insertion-Sort
      • for j = 2 to n do
        • current = A[j] next current
        • i = j - 1 go left
        • while i > 0 A[i] & A[i] > current do find place for current
          • A[i + 1] = A[i] shift sorted right
          • i = i - 1 go left
        • A[i + 1] = current put current in place
  • 8. Running Time
    • Depends on
      • input size
      • input quality (partially ordered)
    • Kinds of analysis
      • Worst case (standard)
      • Average case (sometimes)
      • Best case (never)
  • 9. Asymptotic Analysis
    • Ignore machine dependent constants
    • Look at growth of T(n) while n  
    • O - notation
    • O(n^3)>O(n^2)
  • 10. Insertion Sort Analysis
    • Worst Case O (n^2)
    • Average Case O (n^2)
    • Can we do better?
    • New paradigms