An algorithm is a finite, ordered set of unambiguous steps that solves a problem or performs a computation. Every program you ever write is an algorithm expressed in a programming language. In Bangladeshi government job exams (BCS, Bank IT/AGM, IT-officer, teacher recruitment), this topic is a reliable source of marks: you are asked to identify flowchart symbols, read a flowchart or pseudocode and predict its output, count the number of moves in Tower of Hanoi, compute a GCD or factorial by tracing, or state the difference between iteration and recursion. These are "sure marks" if you master a small set of classic algorithms and the standard flowchart notation.
This lesson builds everything from first principles: what an algorithm is, how it differs from a flowchart and pseudocode, the five standard flowchart symbols, and then roughly twenty classic algorithms — each with a flowchart or pseudocode plus a full numeric trace so you can reproduce the answer under exam pressure.
Learning objectives
- Define algorithm, flowchart, and pseudocode and distinguish them precisely.
- Recognise and draw the five core flowchart symbols and read any exam flowchart.
- Trace and reproduce the classic algorithms: GCD, LCM, factorial, prime check, Fibonacci, Tower of Hanoi, reverse a number, sum of digits, Armstrong number, palindrome, leap year, max/min in an array, equilibrium index, kth largest, linear search, swap, matrix multiplication, and pattern printing.
- Trace a recursive function: count the calls and compute the return value.
- Compare iterative and recursive solutions and choose correctly.