Synchronizing… Device clock
0 / 23 studied Lecture 01 · Introduction to Programming

IIT Indore · CS103

Introduction to Programming.

Learn how to approach unfamiliar problems, model them precisely, choose an algorithm, verify it, and improve it—while building expressive modern C++ systems that come alive on screen.

Modern C++ · Rust glimpse 14 project milestones Algorithms made visible
#include <iostream>

int main() {
    std::cout
        << "Think. Build. Learn.";

    return 0;
}

Announcements

Course notices, kept on record.

Announcements made in class are recorded here. Where the two differ, the email sent to the class takes precedence over this page, since the page is sometimes updated a little later.

14 September 2026 · No B-batch labs this week

There will be no labs this week for the B batch. All the best for the mid-semester examination. Sample questions are up.

Quizzes · Best 2 of 3 count

The best 2 out of 3 quizzes will be considered for evaluation.

  • Scheduling a further quiz before the mid-semester examination looks difficult: no common slot or room is available for a cohort this size
  • If no suitable slot is found, the remaining two quizzes will be held after the mid-semester examination

Mid-semester examination format

Six sections, two hours, recorded out of 60: true or false with a reason, match the concepts, complete the code, does it compile and what happens, determine the output, and a bonus trivia section that counts towards the total but cannot lift it above 60.

Laboratory scoring · Best n−1 labs count

If there are n labs in total, the best n−1 lab scores count towards the final laboratory component, and the weightage is adjusted accordingly.

  • A lab missed on an approved medical absence is scored as the average of that student’s remaining labs
  • Labs for the B1 and B2 batches were not held on 5 October; those batches shifted by one week

Medical absences

Lectures and labs missed for medical reasons are considered for attendance, subject to the applicable Academic Section rules. Absences for other reasons cannot be considered under these provisions.

The course vision

Learn to think before you type.

Syntax is a tool. The durable skill is turning an unfamiliar situation into a model, an algorithm, evidence, and a better second attempt.

  1. ApproachRestate the goal, work a tiny example, and identify what is known.
  2. ModelChoose the state, operations, constraints, inputs, and desired outputs.
  3. ChooseMatch the structure to a technique: simulation, search, greedy, recursion, or more.
  4. VerifyUse invariants, boundary cases, traces, tests, and explanations—not hope.
  5. ImproveMeasure time, memory, clarity, and generality; then revise deliberately.

Problems evolve

A grid becomes a graph; one robot becomes a team; a working search becomes a shortest-path algorithm. Each project is the next question hiding inside the previous one.

Compare, do not imitate

We keep brute force as a trustworthy baseline, then compare divide-and-conquer, greedy, dynamic programming, backtracking, graph, and randomized strategies.

Make thinking visible

Every major algorithm is traced by hand, animated in the terminal, rendered as ASCII or HTML/SVG, and finally organized as clean modular code.

Modern C++ · our main workshop

C++ makes data representation, performance, value semantics, and abstraction visible. We favor standard-library containers, range-based loops, const-correct interfaces, RAII, tests, and small composable functions.

Rust · a glimpse ahead

Short comparisons show how ownership, borrowing, pattern matching, and strong tooling can prevent whole classes of systems bugs. Different languages encode different trade-offs; choosing one is an engineering decision.

A glimpse of the finish line

Systems you will know how to build.

Open any build to see the model beneath the spectacle. Each demonstration becomes a project, then a platform for your own extension.

Simulation · gridsCleaning robotWatch a robot sweep a dirty 2D room and explain every decision.
Computational model
Discrete time steps on a bounded 2D grid with walls, dirt, and a robot pose.
Abstraction
The physical room becomes cells; sensing and motion become state transitions.
Data structures
vector<string>, coordinate pairs, direction arrays, and a visited matrix.
Algorithmic ideas
Simulation, loop invariants, coverage strategies, and a brute-force baseline.
Extensions
Battery limits, unknown rooms, noisy sensors, and randomized exploration.
Graphs · searchCleaning a networkThe same robot leaves the grid and cleans rooms connected by corridors.
Computational model
A graph whose vertices are rooms and whose edges are traversable corridors.
Abstraction
Geometry is discarded; only connectivity and edge cost remain.
Data structures
Adjacency lists, queue or stack, visited set, and parent map.
Algorithmic ideas
BFS, DFS, spanning trees, reachability, and correctness by discovered frontier.
Extensions
Directed passages, weighted travel, re-contamination, and online graph discovery.
Images · componentsObject discretizationTurn pixels or occupied cells into separate, measurable objects.
Computational model
A binary image or occupancy grid with four- or eight-neighbour adjacency.
Abstraction
An object is a maximal connected component, independent of its visual label.
Data structures
Matrix, component labels, coordinate queue, and component records.
Algorithmic ideas
Flood fill, recursive DFS, BFS, counting, and boundary handling.
Extensions
Area, perimeter, bounding boxes, holes, colour segmentation, and image compression.
Objects · coordinationMulti-agent cleaningModel a fleet whose agents share work without colliding.
Computational model
Many autonomous agents update within a shared world and a scheduling policy.
Abstraction
World, Agent, Task, and Policy classes separate responsibilities.
Data structures
Object collections, queues, maps, event log, and reservation table.
Algorithmic ideas
Object-oriented modeling, greedy assignment, simulation, and conflict resolution.
Extensions
Auctions, heterogeneous agents, failure recovery, fairness, and emergent swarm rules.
Paths · gridShortest path on a mapAnimate a wavefront through a maze and reconstruct the route.
Computational model
A grid graph with passable cells and optional movement costs.
Abstraction
Each cell is a state; moves are edges; distance is the optimization objective.
Data structures
Queue or priority queue, distance matrix, parent matrix, and frontier.
Algorithmic ideas
BFS, Dijkstra, A* heuristics, path reconstruction, and admissibility.
Extensions
Diagonal moves, terrain cost, dynamic obstacles, and multiple destinations.
Paths · graphsRoute plannerFind and justify the best route through a weighted network.
Computational model
A weighted directed or undirected graph with non-negative edge costs.
Abstraction
Locations are vertices; time, distance, or risk becomes edge weight.
Data structures
Weighted adjacency list, min-priority queue, distance and predecessor maps.
Algorithmic ideas
Dijkstra, greedy choice, relaxation, shortest-path trees, and counterexamples.
Extensions
Multi-criteria routes, negative weights, all-pairs paths, and live traffic updates.
Game · linked stateSnake, from string to gameRepresent a moving body, enforce its invariant, and make it playable.
Computational model
A timed grid simulation with input, collision rules, food, and score.
Abstraction
The snake is an ordered path: first as a string of moves, then as linked segments.
Data structures
Deque or linked list, occupancy set, direction vector, and game-state object.
Algorithmic ideas
State machines, constant-time head/tail updates, invariants, and randomized food placement.
Extensions
Replay logs, AI with search, obstacles, two-player mode, and procedural levels.
Terminal · animationASCII rendererMake algorithms come alive with portable terminal frames.
Computational model
A frame buffer periodically re-rendered from the current simulation state.
Abstraction
Models emit renderable snapshots; the view owns symbols, colour, and timing.
Data structures
Character matrix, frame history, event stream, and double buffer.
Algorithmic ideas
ASCII graphics, ANSI control, delta rendering, animation loops, and modular views.
Extensions
Pause/step controls, recorded replays, plots, accessibility palettes, and benchmarking.
Web & C++ graphicsInteractive visual labMove one algorithm from terminal traces to HTML/SVG and modern C++ graphics.
Computational model
A deterministic event stream drives several independent views.
Abstraction
Algorithm, controller, and renderer communicate through clean interfaces.
Data structures
Snapshot records, scene graph, event queue, and geometry primitives.
Algorithmic ideas
Model-view separation, observer pattern, interpolation, and reproducible replay.
Extensions
HTML/SVG controls, Canvas, SFML/SDL visualizers, speed scrubber, and comparison mode.
Music · recursionProcedural composerGenerate melodies from rules, probability, and repeated structure.
Computational model
A discrete timeline of notes with pitch, duration, velocity, and instrument.
Abstraction
Musical phrases become transformable sequences and recursive grammars.
Data structures
Note vectors, trees of phrases, weighted choices, and MIDI event lists.
Algorithmic ideas
Recursion, randomized algorithms, dynamic programming for rhythm, and constraints.
Extensions
Markov melodies, harmony search, live controls, MIDI export, and student-composed rules.
Optimization · circuitsCircuit optimizerSearch equivalent designs for a smaller or faster logical circuit.
Computational model
A Boolean expression or directed acyclic graph of logic gates.
Abstraction
Equivalent truth tables define correctness; gate count and depth define cost.
Data structures
Expression tree, DAG, truth-table bitsets, and memoization map.
Algorithmic ideas
Brute force, divide and conquer, dynamic programming, local greedy rewrites, and verification.
Extensions
Multiple cost models, common-subexpression sharing, SAT-based search, and visualization.
Search · generationMaze and puzzle forgeCreate solvable worlds, then challenge an algorithm—and a human—to solve them.
Computational model
A state space with legal moves, goal tests, and generated constraints.
Abstraction
Mazes, Sudoku-like puzzles, and games share search states and transitions.
Data structures
Grid or graph, recursion stack, candidate sets, and seeded random generator.
Algorithmic ideas
Backtracking, randomized DFS, pruning, heuristics, and uniqueness checking.
Extensions
Difficulty rating, daily seeds, competitive solvers, generative art, and web sharing.
One algorithm, many lenses paper tracetests & invariantsterminal stepsASCII animationHTML/SVGinteractive graphicsobject-oriented modelclean modules

Semester studio

One growing system, every week.

Each milestone includes a working build, a visual explanation, focused challenges, and one open-ended “what if?” exploration.

  1. Week 01

    Command a robot

    Write precise movement instructions, trace state by hand, and ship a tiny terminal robot.

    Decomposition · tests · brute force
  2. Week 02

    Build the grid world

    Model cells, walls, dirt, coordinates, and safe input; render the state as ASCII.

    Types · state · simulation
  3. Week 03

    Make it sweep

    Compare row sweep, wall following, and random walks; define a coverage metric.

    Loops · invariants · randomized algorithms
  4. Week 04

    Discover objects

    Label connected components and animate flood fill one frontier at a time.

    Recursion · DFS · BFS
  5. Week 05

    Find a route

    Turn the grid into a graph, run BFS, reconstruct a shortest path, and test unreachable cases.

    Graph modeling · shortest paths
  6. Week 06

    Move to weighted maps

    Compare BFS, Dijkstra, and a greedy nearest-target policy with visible counterexamples.

    Priority queues · greedy methods
  7. Week 07

    Ship Snake

    Build the timed game, first with sequence state and then constant-time head/tail updates.

    Strings · deques · linked structures
  8. Week 08

    Refactor into objects

    Separate model, renderer, input, and policies; explain and protect each class invariant.

    OOP · interfaces · value semantics
  9. Week 09

    Coordinate a fleet

    Assign cleaning tasks to several agents, detect collisions, and compare fairness strategies.

    Simulation · greedy assignment
  10. Week 10

    Search difficult worlds

    Generate mazes, solve them with backtracking, and use heuristics to prune the search tree.

    Backtracking · search · pruning
  11. Week 11

    Remember useful work

    Optimize repeated subproblems in paths, sequences, or rhythm generation; plot the speedup.

    Dynamic programming · memoization
  12. Week 12

    Divide the problem

    Visualize merge sort or spatial decomposition and compare empirical growth curves.

    Divide and conquer · complexity
  13. Week 13

    Publish a visual explainer

    Replay algorithm events in terminal and HTML/SVG or a modern C++ graphics library.

    Modularity · visualization · documentation
  14. Week 14

    Capstone showcase

    Extend one system, validate it with evidence, teach it live, and submit it to the Hall of Fame.

    Independent learning · synthesis

Lecture 01 · the launch

No “Hello, World” without a world.

The first meeting starts with the end-of-course demos, then students make a robot succeed before learning the C++ needed to express their reasoning.

See the future

Live Snake, robot, route planner, music, and visualization demos. Students predict the hidden state and rules.

Model together

Human teams act as robots on a drawn grid. Ambiguous instructions fail safely and become precise algorithms.

Build in pairs

Translate a tiny sweep into C++, trace every variable, test edge cases, and change one rule.

Explain & reflect

Compare solutions, name an invariant, write the next question, and leave with a runnable artifact.

Course roadmap

From first principles to real programs.

Nine connected modules move from C++ fundamentals to practical systems, with algorithms taught as applications of the structures they operate on.

Phase 01 · Foundations

Before mid-semester

  1. 01

    Programming & Problem Solving

  2. 02

    Types, Expressions & Program State

  3. 03

    Decisions & Iteration

  4. 04

    Functions & Recursive Decomposition

  5. 05

    Sequences, Text & Array Algorithms

Phase 02 · Application

After mid-semester

  1. 06

    Records, Pointers & Memory

  2. 07

    Linear & Tree Data Structures

  3. 08

    Object Design & Value Semantics

  4. 09

    Inheritance, Polymorphism & Applied Systems

Assessment

How progress is measured.

The formal weights stay transparent; the learning practice underneath them rewards reasoning, evidence, reflection, and sustained growth.

Reasoning countsState the model, strategy, and invariant—not only the final output.
Evidence countsUse examples, boundary cases, tests, traces, and measurements.
Revision countsAct on feedback, document changes, and compare the improved design.
Growth countsConsistent effort and increasingly independent work matter more than an early stumble.

CS 103

Course assessment · total 100%

  • Attendance Consistent participation
    5%
  • Quizzes · best 2 of 3 Loading quiz date… Loading quiz date… Quiz 3 · date to be announced
    15%
  • Mid-semester examination Foundations and structured problem solving
    30%
  • End-semester examination Comprehensive course assessment
    50%

IC 151

Laboratory course · practice and demonstration

  • Regular labs Best n−1 lab scores
    72%
  • Final lab examination Applied programming assessment
    28%
Open lab setup & batch schedule

Relative grade percentile curve

AS is reserved for the top 1%; AA targets the next 15%, with μ + 2σ marked as its statistical reference.

Relative grade percentile curve A bell curve divided from F through DD, CD, CC, BC, BB, AB, AA, and AS. AS is the top one percent. AA is the next fifteen percent, and mean plus two standard deviations lies within AA.
F 0–12% DD 12–24% CD 24–36% CC 36–48% BC 48–60% BB 60–72% AB 72–84% AA 84–99% AS 99–100%

Grading disclaimer This distribution is provisional and not final. Grade boundaries and final letter-grade assignments remain at the instructor’s discretion, subject to institute rules.

Hall of Fame

Work worth remembering.

With student permission, exceptional projects become a permanent gallery of runnable demos, code, design notes, and lessons learned for future cohorts.

Your project can become next year’s first spark.

The gallery celebrates many kinds of excellence—not only the highest score. Future students see what peers made possible and begin with a larger sense of possibility.

Selections use published rubrics, credit every collaborator, preserve accessible documentation, and never publish student work without explicit consent.
  • 01Best visualization
  • 02Fastest algorithm
  • 03Most elegant code
  • 04Most creative project
  • 05Best documentation
  • 06People’s choice

The instructor’s promise

You will not learn alone.

By the end of this course, you will be able to meet unfamiliar programming problems with the calm, structured confidence of a strong programmer: make a model, choose a strategy, test your reasoning, and improve what you built.

I will be available to help you learn and to work through the obstacles that serious learning inevitably creates. Ask early, bring imperfect attempts, and show your reasoning. Confusion is not a verdict; it is information we can use.

Our practice follows research-backed principles: active recall, worked examples, deliberate practice, timely feedback, collaboration, and repeated opportunities to transfer an idea into a new setting. Every lecture aims to earn your attention by giving you a new way to think—not another page of syntax to memorize.

Your growth matters more than a single grade. Consistent, honest effort, reflection, and revision will be recognized. I cannot promise that the course will always feel easy. I can promise that the difficulty will have a purpose, that your questions will matter, and that you will leave able to learn far beyond this syllabus.

— Dr. Debasish Pattanayak

Learning community

A studio, not a spectator sport.

We build a culture where unfinished thinking is welcome, feedback is specific, and explaining an idea strengthens everyone’s understanding.

Pair & rotate

Driver and navigator roles change often so every student practices implementation and strategic thinking.

  • Explain before editing
  • Rotate partners across backgrounds
  • Credit ideas and assistance

Demo circles

Weekly five-minute showcases normalize partial progress and reveal multiple valid approaches.

  • Show one success and one surprise
  • Ask “what did you try?”
  • Archive useful traces and tests

Help that teaches

Office hours and peer support focus on questions, models, and debugging habits—not copying finished answers.

  • Bring the smallest failing example
  • Use a shared debugging checklist
  • Escalate blockers early

Choice with belonging

Open-ended extensions let interests in games, robotics, art, systems, science, or music shape the same core ideas.

  • Accessible formats by default
  • Low-bandwidth alternatives
  • Community agreements revisited together

Reference textbooks

Read alongside the lectures.

The lectures are self-contained; these books supply the standard terminology, deeper explanations, and extra practice problems.

Programming: Principles and Practice Using C++

Bjarne Stroustrup · 3rd edition, Addison-Wesley, 2024.

  • The introductory text by the creator of C++
  • Covers every module of this course in modern C++
  • Primary reference for terminology and style

Problem Solving with C++

Walter Savitch · 10th edition, Pearson, 2018.

  • Gentler pace with many worked examples
  • Strong on functions, arrays, and recursion drills
  • Good source of additional lab-style exercises

Resources

Extra material worth your time.

Optional companions to the lectures. Nothing here replaces the deck or the lab work, but each one covers the same ideas from a different angle.

Semicolon — Midsem recap music video

CS103 · a three-minute lyric video covering Lectures 1–11.

  • One missing semicolon, 203 errors, and every idea from the first half of the course
  • A quick way to revise before the mid-semester examination
  • Watch on YouTube

C++ Programming Course — Beginner to Advanced

freeCodeCamp.org · full-length video course on YouTube.

  • Covers the language from first principles through to advanced features
  • Useful for revisiting a topic at your own pace after the lecture
  • Watch on YouTube

Timeline

Lecture schedule.

Autumn 2026
Date Module Topic
Loading the Autumn 2026 schedule…