Download presentation
Presentation is loading. Please wait.
Published byClaud Rogers Modified over 9 years ago
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
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
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.