Page 118 - Computer science 868 Class 12
P. 118
Let’s Revisit
♦ An algorithm is a set of well-defined finite steps or rules to be followed to solve any problem.
♦ Pseudo code is a representation of an algorithm in any standard human readable language and mathematical notations.
♦ Flowchart is a pictorial representation of an algorithm using standard symbols.
♦ There are several symbols in a flowchart namely the start/stop box, input/output box, processing box, decision box, flow
lines, connectors, etc.
♦ Big O notation is the measurement of the growth rate of an algorithm with an increase in its input size. It defines the upper
bound of an algorithm or the maximum time taken by an algorithm for a given input size.
♦ Best case complexity: For any input of size ‘n’ the function takes the minimum time or the minimum number of steps for
execution. It defines the lower bound of an algorithm.
♦ Worst case complexity: For any input of size ‘n’, the function takes the maximum time or the maximum number of steps
required for execution. It defines the upper bound of an algorithm.
♦ Average case complexity: In the average case analysis, we take all possible input combinations and calculate their
individual computation time and then calculate the average of all the data. So, this calculates the average time taken by
the algorithm for execution.
♦ A good algorithm should have the following properties: accuracy, finiteness, input, output, language independence,
effectiveness.
MIND DRILL
Solved Questions
A. Tick ( ) the correct option:
1. A/An ………………… is a set of well-defined finite steps or rules to be followed to get the desired result.
a. program b. flow chart
c. pseudocode d. algorithm
2. Which of the following is false about an algorithm?
a. It is written stepwise. b. We can measure the performance of an algorithm.
c. It is dependent on the programming language. d. Complex algorithms are difficult to design.
3. LIFO stands for
a. Last In First Out b. Last In Front Out
c. Least In First Out d. Load In Force Out
4. In the Bubble sort algorithm each element is compared with its ………………… element.
a. first b. next
c. last d. all
5. In a linked list the elements are not ………………… .
a. linear b. contiguous
c. homogenous d. finite
Answers
1. d 2. c 3. a 4. b 5. b
B. Fill in the blanks:
1. ………………… is a representation of an algorithm in any standard human readable language and mathematical notations.
2. Queue follows ………………… principle.
116116 Touchpad Computer Science-XII

