Notes · Class 12 · CBSE · Science Computer Science

Alorithms notes

Revision notes for the chapter: the key points, definitions and exam tips to remember.

An algorithm is a finite sequence of clear steps to solve a problem.

CHARACTERISTICS

  • Input, output, definiteness (each step is clear), finiteness (ends after finite steps), effectiveness (simple enough to carry out).

REPRESENTATION

  • Flowcharts and pseudocode.

COMPLEXITY

  • Time complexity: how running time grows with input size n.
  • Space complexity: how much memory is needed.
  • Big-O notation (worst case):
    • O(1): constant (access an array element).
    • O(log n): binary search.
    • O(n): linear search.
    • O(n log n): efficient sorting.
    • O(n²): bubble, selection, insertion sort (nested loops).

COMPARING ALGORITHMS

  • For large n, lower-order growth wins: O(log n) < O(n) < O(n log n) < O(n²) < O(2ⁿ).
  • Best, average and worst cases.
Memory hook: "Good algorithm: correct, finite, efficient — measured by Big-O."

Alorithms: practice questionsAlorithms cheat sheet

More Class 12 · CBSE · Science Computer Science notes

Practise Alorithms

Sign up free to practise the full chapter after revising. Questions you get wrong come back until you've mastered them.

Start practising free

Free to start · No credit card needed