0% found this document useful (0 votes)
41 views

Time Complexity

The document discusses time and space complexity analysis of algorithms. It covers experimental and theoretical analysis of sorting algorithms like selection sort, merge sort, bubble sort, and binary search. Examples are provided for analyzing the complexity of nested for loops and recursive functions. The lecture concludes with a discussion of space complexity and going through assignments.

Uploaded by

MRINAAL GOSAIN
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views

Time Complexity

The document discusses time and space complexity analysis of algorithms. It covers experimental and theoretical analysis of sorting algorithms like selection sort, merge sort, bubble sort, and binary search. Examples are provided for analyzing the complexity of nested for loops and recursive functions. The lecture concludes with a discussion of space complexity and going through assignments.

Uploaded by

MRINAAL GOSAIN
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Friday, 07 October

2016

Launchpad
Lecture -11

Time Complexity

Prateek
Narang
2 Friday, 07 October 2016

Doubts ?
3 Friday, 07 October 2016

Order Complexity Analysis

Amount of time/space taken by the algorithm


to run as a function of the input size
4 Friday, 07 October 2016

Experimental Analysis

 Selection Sort vs Merge Sort


5 Friday, 07 October 2016

Theoretical Analysis

 Bubble Sort
 Binary Search
 Factorial
 Polynomial Evaluation
6 Friday, 07 October 2016

Your turn

 Insertion
sort
 Fibonacci
 Assignment 3 and assignment 4 solutions
7 Friday, 07 October 2016

Complexity Analysis Examples

for (i=0; i<=n-1; i++){


for (j=i+1; j<=k; j++){
constant number of operations.
}
}
8 Friday, 07 October 2016

Complexity Analysis Examples

for (i=0; i<=n-1; i++){


for (j=i+1; j<=n; j++){
constant number of operations.
}
}
9 Friday, 07 October 2016

Complexity Analysis Examples

for (i=0; i<=n-1; ){


for (j = 0; j<k; j++){
constant number of operations.
}
i = i + j;
}
10 Friday, 07 October 2016

What is space complexity?


11 Friday, 07 October 2016

What in case of recursion?


12 Friday, 07 October 2016

Lets go through the


assignments
13 Friday, 07 October 2016

Thank You!

Prateek Narang
[email protected]

You might also like