Presentation is loading. Please wait.

Presentation is loading. Please wait.

Visit for more Learning Resources

Similar presentations


Presentation on theme: "Visit for more Learning Resources"— Presentation transcript:

1 Visit for more Learning Resources
Chapter 1 Visit for more Learning Resources

2 An Algorithm is a finite set of instructions that if followed accomplishes a particular task.

3

4 Finiteness Definiteness Effectiveness Input Output

5 Name of the algorithm and an introductory Comment.
Steps Comments Assignments Statements Exit Statement Variable Name Operators Input and Output Statements Flow Chart

6 Name of the algorithm and an introductory Comment.
LINEAR_SEARCH(A,N,KEY) [ ALGORITHM TO PERFORM LINEAR SEARCH]

7 Steps 1. …….. 2…….. 3…….

8 COMMENTS [ ] Comments are written in brackets

9 Assignments Statements
Dot and equal to O= Var o= 45

10 Exit Statement Exit / finished / end

11 Variable Name In capital Eg :- VAR1 VAR2

12 OPERATORS LOGICAL OPERATOR (AND &&,OR ||,NOT !)
RELATIONAL OPERATOR (<,>,<=,>=) ARTHEMATIC OPERATOR (+,-,*,/)

13 Input and Output Statements
Read : VAR (SCANF() ) ACCEPT DATA FROM USER Write Message (Printf() print data on the screen

14 Flow Chart

15 Brute Force Divide and Conquer Dynamic Programming Greedy Algorithm

16 Space Complexity It is the amount of memory required for that particular algorithm. Time Complexity Deals with the computing time.

17 void main() { int a; float b,c; c = a+b; printf(“Result = %d”,c) } Space Required = = 10 bytes.

18 void main() { int a; float b,c; c = a+b; printf(“Result = %d”,c); } Total Frequency count = = 4

19 void main() { int a,n; float b,c; n = 3 for(i=0;i<=n;i++) n c = a+b+i; n printf(“Result = %d”,c); n } Total Frequency count = 1+1+n+n+n = 11

20 For more detail contact us
Provides asympostotic upper bound for a given functions Max (O(1),O(n),O(n+1),O(n^2) For more detail contact us


Download ppt "Visit for more Learning Resources"

Similar presentations


Ads by Google