Analysis of Algorithms: CSE 5210 Fall 2013
THREE QUESTIONS IN TWO PAGES
Quiz 1 Points 20
Q2. What is the asymptotic time-complexity of the following pseudo-code fragment in
terms of n:
For i = 1 to n do
For j = i to n do
For k = 1 to 3 do
Count+;
[5]
Q2.
ALGORITHM ANALYSIS
Analysis of Resource consumption by processor
Time
Memory
Number of processors
Power
Proof that the algorithm works correctly
Debasis Mitra
1
ALGORITHM ANALYSIS
Time is measured with Step Counts in an Algorithm
Why?
Not a constant
DIVIDE & CONQUR ALGORITHMS
Often written at first as a recursive algorithm
Masters Theorem:
T(n) = aT(n/b) + cni, for some constant integer i, and
constants of coefficients a and c.
Three cases:
a = = bi, the solution is T(n) = O(ni logb n);
a > bi,
ALGORITHM TYPES
Divide and Conquer, Dynamic Programming, Greedy,
and Backtracking
Note the general strategy from the examples
The classification is neither exhaustive (there may be
other types), nor mutually exclusive (one may
combine)
PROBLEM 1: DYNAM
INTRODUCTION
Why write algorithms:
(1) To get it out of the head, human memory is unreliable!
(2) To communicate with the programmer and other algorithm
developers.
(3) To prove its correctness, to analyze, to improve its efficiency,
ALGORITHM:
What is a
SORTING
Problem: sort a list of numbers (or comparable objects).
Solution: An algorithm.
The problem is interesting for its theoretical value, and for
its practical utility. Many algorithms are available for the
purpose.
Bubble Sort
BubleSort (A)
.1 for i
RECURRENCE EQUATION
We solve recurrence equations often in analyzing complexity of algorithms, circuits, and such other cases. A homogeneous recurrence equation is written as: a0tn + a1tn-1 + . . . . + aktn-k = 0. Solution technique: Step 1: Set up a corr
Research Position in Medical Imaging
Our group works on bio-medical imaging in collaboration with
Lawrence Berkeley National Laboratory in California (LBNL) and with
some local cardiologists. We have three ongoing projects to involve
students in:
(1) Deve
Analysis of Algorithms
CSE 5211, Fall 2015
Instructor: Debasis Mitra, Ph.D.
Office: Harris 325 E-mail: dmitra at cs.fit. edu
Class Home Page: http:/www.cs.fit.edu/~dmitra/Algorithms/
Class Room: Olin LS 130, Class Time: MW 8-9:15pm
Office Hours: T/Th 1-3
CSE 5211
Fall 2015
Preliminary Quiz
Time: 15 min
1. Subtract the second set from the first one: cfw_a, b, c, d\cfw_e, c, f, a
2. Relate Stack and Queue algorithms with First-In-First-Out and Last-In-First-Out strategies.
3. Multiply the two 3x3 matrices: