Step Count Method to Measure Time Complexity of an Algorithm - Part 1

Опубликовано: 19 Январь 2017
на канале: Sunil Dhimal
83,056
1.1k

If my videos have added value to you, join as a contributing member at Patreon:   / sunildhimal  

This video explains how to derive the time complexity of an algorithm using step count method.
Frequency Count method
Time complexity of a loop
Analysis of algorithms with loops
Sum of all elements in an array
Measure time complexity of loop using step count method

Chapters:
0:00 What is the step count method ?
0:50 Algorithm to find sum of elements in an array
1:58 Calculate time complexity
3:03 Step 1: Find cost of each step on an algorithm
3:19 Step 2: Find the frequency of each step
4:12 Calculate the time complexity of assignment statement
4:59 Calculate the time complexity of the for loop
6:51 Calculate the time complexity of the body of for loop
7:17 Calculate the time complexity of the return statement
7:46 Calculate the total time complexity of the given algorithm