📖 generic · 12th TN - English Medium · COMPUTER SCIENCE · Page 37definition

ALGORITHMIC STRATEGIES · Part 3

Chapter 2: 3 · COMPUTER SCIENCE

structured or object oriented programming approach • There is no specific rules for algorithm writing but some guidelines should be followed. • Program should be written for the selected language with specific syntax • Algorithm resembles a pseudo code which can be implemented in any language • Program is more specific to a programming language Table . Algorithm Vs Program . .

. Analysis of Algorithm Computer resources are limited. Efficiency of an algorithm is defined by the utilization of time and space complexity. 12th Computer Chapter - - Analysis of an algorithm usually deals with the running and execution time of various operations involved.

The running time of an operation is calculated as how many programming instructions executed per operation. Analysis of algorithms and performance evaluation can be divided into two different phases: . A Priori estimates: This is a theoretical performance analysis of an algorithm. Efficiency of an algorithm is measured by assuming the external factors.

. A Posteriori testing: This is called performance measurement. In this analysis, actual statistics like running time and required for the algorithm executions are collected. An estimation of the time and space complexities of an algorithm for varying input sizes is called algorithm analysis.

Complexity of an Algorithm . Suppose A is an algorithm and n is the size of input data, the time and space used by the algorithm A are the two main factors, which decide the efficiency of A. Time Factor -Time is measured by counting the number of key operations like comparisons in the sorting algorithm. Space Factor - Space is measured by the maximum memory space required by the algorithm.

The complexity of an algorithm f (n) gives the running time and/or the storage space required by the algorithm in terms of n as the size of input data. . . Time Complexity The Time complexity of an algorithm is given by the number of steps taken by the algorithm to complete the process.

. . . Space Complexity Space complexity of an algorithm is the amount of memory required to run to its completion.

The space required

Related topics

Have a question about this topic?

Get an AI answer grounded in your actual textbook — with the exact page reference.

Ask AI about this topic →