02 Algorithms and Flow Charts
02 Algorithms and Flow Charts
An algorithm is a step-by-step procedure for solving a problem. It contains calculations, reasoning, and
data processing. Algorithms can be represented by natural languages, pseudocode, and flowcharts
Algorithms are generally divided into six fundamental types based on their function:
i) Recursive algorithm
ii) Divide and conquer algorithm
iii) Dynamic programming algorithm
iv) Greedy algorithm
v) Brute force algorithm
vi) Backtracking algorithm
Flowcharts are often used as a program planning tool to organize the program’s step-by-step process
visually. Here are some examples:
Algorithm: Flowchart:
START
• Step 1: Initialize X as 0,
• Step 2: Increment X by 1,
• Step 3: Print X,
• Step 4: If X is less than 20 then go back to INITIALIZE
X0
step 2.
INCREMENT X BY 1
XX+1
PRINT X
YES
X < 20
NO
END
Algorithm Flowchart
C 5/9 * (F - 32)
PRINT C
END
Algorithm Flowchart
PRINT PRINT
FAIL PASS
END