Presentation is loading. Please wait.

Presentation is loading. Please wait.

Algorithm Analysis (Time complexity). Software development cycle -Four phases: 1.Analysis 2.Design Algorithm Design an algorithm to solve the problem.

Similar presentations


Presentation on theme: "Algorithm Analysis (Time complexity). Software development cycle -Four phases: 1.Analysis 2.Design Algorithm Design an algorithm to solve the problem."— Presentation transcript:

1 Algorithm Analysis (Time complexity)

2 Software development cycle -Four phases: 1.Analysis 2.Design Algorithm Design an algorithm to solve the problem or sub- problem. Algorithm is step by step problem-solving process, and solution obtained in finite amount of time. 3.Implementation 4.Testing and Debugging

3

4

5

6

7 Algorithm Analysis: The Big-O Notation (cont’d.) Primitive Operations: -By analyzing a particular algorithm, we usually count the number of Primitive Operations: 1. Assigning a value to a variable 2.Calling a function 3.Performing an arithmetic operation 4.Comparing two values 5.Returning from a function

8

9

10

11

12 The Big-O Notation (cont’d.) -The following table shows each of the seven common functions used in algorithm analysis in order of growth rates. Examples: 1- F(n) = 5n 2 + 3n log n + 2n + 5 We say the function F(n) is O(n 2 ) or Big-O of n 2 2- F(n)= 3 log n + 2 We say the function F(n) is O(log n) or Big-O of log n 3- F(n)= 2n + 100 log n We say the function F(n) is O(n) or Big-O of n constantlogarithmlinearn-log-nquadraticcubicexponential 1log nnn log nn2n2 n3n3 a n, a>1


Download ppt "Algorithm Analysis (Time complexity). Software development cycle -Four phases: 1.Analysis 2.Design Algorithm Design an algorithm to solve the problem."

Similar presentations


Ads by Google