Unit 1Basics of an Algorithm and its Properties
Follows IGNOU MCS-211, Block 1 Unit 1
An algorithm is a precise, step-by-step method for solving a problem. Every program you write is an algorithm expressed in a programming language, so learning to design and judge algorithms is the core skill of computer science. This unit gives you the vocabulary for the whole course: what makes a procedure an algorithm, how algorithms are built, how fast common algorithms grow, how we measure efficiency, which kinds of problems appear again and again, and which general techniques solve them.
In this unit you will learn to
- define an algorithm and list its five essential properties;
- name the building blocks of algorithms (sequencing, selection, iteration, procedure, recursion);
- recognise the common running times, from constant to factorial, and the loop shapes that produce them;
- explain time and space complexity and the best, worst and average case;
- classify problems into standard types (sorting, searching, graphs and more);
- describe the main design techniques (brute force, divide and conquer, greedy, dynamic programming, branch and bound, randomized, backtracking);
- tell deterministic algorithms from stochastic (randomized) ones.
Sections in this unit
- 1.1What Is an Algorithm?The meaning of an algorithm, its five essential properties (Knuth) and the qualities that make an algorithm good.12 min
- 1.2Euclid's Algorithm: A First ExampleEuclid's GCD algorithm in pseudocode and C, a full trace for gcd(1071, 462), and why the loop must return a, not b.7 min
- 1.3Building Blocks of AlgorithmsSequencing, selection and iteration, plus procedures and recursion, with C examples and the conditions for correct recursion.10 min
- 1.4Common Running Times: Constant to CubicRunning time as a count of steps, and the constant, logarithmic, linear, n log n, quadratic and cubic classes with their loop shapes.11 min
- 1.5Common Running Times: Polynomial, Exponential and FactorialThe n^k, 2^n and n! classes through independent set, matching and travelling-salesman brute force, with a growth table.10 min
- 1.6Analysis of Algorithms: Best, Worst and Average CaseTime and space complexity, best/worst/average case of linear search with (n+1)/2, and a first look at O, Ω and Θ notation.13 min
- 1.7Types of Computational ProblemsThe standard problem types—sorting, searching, strings, graphs, combinatorial, geometric, numerical—with stability and in-place sorting.11 min
- 1.8Problem-Solving TechniquesBrute force, divide and conquer, greedy, dynamic programming, branch and bound, randomized and backtracking design techniques compared.16 min
- 1.9Deterministic and Stochastic AlgorithmsDeterministic versus randomized (stochastic) algorithms, Las Vegas and Monte Carlo types, and pseudorandom versus secure random numbers.10 min