01-Analysis-of-Algorithms

# 01-Analysis-of-Algorithms - Algorithms LECTURE 1 Analysis...

This preview shows pages 1–17. Sign up to view the full content.

Algorithms Professor Ashok Subramanian L ECTURE 1 Analysis of Algorithms Insertion sort Asymptotic analysis Merge sort Recurrences

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Algorithms L1.2 Analysis of algorithms The theoretical study of computer- program performance and resource usage. What’s more important than performance? modularity correctness maintainability functionality robustness user-friendliness programmer time simplicity extensibility reliability
Algorithms L1.3 Why study algorithms and performance? Algorithms help us to understand scalability . Performance often draws the line between what is feasible and what is impossible. Algorithmic mathematics provides a language for talking about program behavior. Performance is the currency of computing. The lessons of program performance generalize to other computing resources. Speed is fun!

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Algorithms L1.4 The problem of sorting Input: sequence a , a , …, a of numbers. Example: Input: 8 2 4 9 3 6 Output: 2 3 4 6 8 9 Output: permutation a' , a' , , a' such
Algorithms L1.5 Insertion sort I NSERTION -S ORT ( A , n ) A [1 . . n ] for j ← 2 to n do key ← A [ j ] i ← j – 1 while i > 0 and A [ i ] > key do A [ i+ 1] ← A [ i ] i ← i – 1 A [ i+ 1] = key “pseudocode”

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Algorithms L1.6 Insertion sort I NSERTION -S ORT ( A , n ) A [1 . . n ] for j ← 2 to n do key ← A [ j ] i ← j – 1 while i > 0 and A [ i ] > key do A [ i+ 1] ← A [ i ] i ← i – 1 A [ i+ 1] = key “pseudocode” sorted i j key A : 1 n
Algorithms L1.7 Example of insertion sort 8 2 4 9 3 6

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Algorithms L1.8 Example of insertion sort 8 2 4 9 3 6
Algorithms L1.9 Example of insertion sort 8 2 4 9 3 6 2 8 4 9 3 6

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Algorithms L1.10 Example of insertion sort 8 2 4 9 3 6 2 8 4 9 3 6
Algorithms L1.11 Example of insertion sort 8 2 4 9 3 6 2 8 4 9 3 6 2 4 8 9 3 6

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Algorithms L1.12 Example of insertion sort 8 2 4 9 3 6 2 8 4 9 3 6 2 4 8 9 3 6
Algorithms L1.13 Example of insertion sort 8 2 4 9 3 6 2 8 4 9 3 6 2 4 8 9 3 6 2 4 8 9 3 6

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Algorithms L1.14 Example of insertion sort 8 2 4 9 3 6 2 8 4 9 3 6 2 4 8 9 3 6 2 4 8 9 3 6
Algorithms L1.15 Example of insertion sort 8 2 4 9 3 6 2 8 4 9 3 6 2 4 8 9 3 6 2 4 8 9 3 6 2 3 4 8 9 6

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Algorithms L1.16 Example of insertion sort 8 2 4 9 3 6 2 8 4 9 3 6 2 4 8 9 3 6 2 4 8 9 3 6 2 3 4 8 9 6
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 04/29/2011 for the course IT 201 taught by Professor K.v.arya during the Spring '11 term at IIT Kanpur.

### Page1 / 51

01-Analysis-of-Algorithms - Algorithms LECTURE 1 Analysis...

This preview shows document pages 1 - 17. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online