Dive into the world of computational problem-solving with this hands-on programming course for C++ and Python users, built on the philosophy of learning by doing. Master control structures, functions, structured data, arrays/lists, references & pointers (or object references), and static vs dynamic memory models while exploring stack and heap through visual memory diagrams.

Engage in extensive problem-solving practices and analytical exercises that strengthen logical thinking, algorithmic design, and code reusability. Experience the excitement of building many real-world projects—from Conway’s Game of Life to GOMOKU, and the final masterpiece—The Game of Chess.
A journey designed to turn programming principles into precision, creativity, and mastery, regardless of whether you code in C++ or Python.

Lecture 1: The Quest of Finding “THE ALGORITHM”

Students explore computation as a problem-solving discipline and understand what computers and algorithms are. They tackle the Heaviest Ball guessing game and analyze counting and exponential functions to understand efficiency and parallel reasoning.

  • C++: Procedural problem-solving, explicit step counting, performance-focused logic
  • Python: Algorithmic reasoning with readable syntax and abstraction for parallel problems
Lecture 2: Introduction to Programming (Table Printing)

Students write their first programs, learn Hello World, display strings and math expressions, and print tables with fixed values. Introduction to variables and iteration (while loop) sets the foundation for structured programs.

  • C++: cout, explicit types, while loops, console-based table printing
  • Python: print(), dynamic typing, indentation-based loops, formatted output
Lecture 3: Control Structures

Covers integers, operators (+,-,*,/,%), conditional statements (if/else/else-if), divisibility, compound statements (&&,||), and ASCII-based character operations. Students also implement maximum-of-five logic and compare naive vs efficient approaches.

  • C++: if/else branching, char type, ASCII handling, logical operators
  • Python: if/elif/else, string and integer operations, and/or for compound conditions
Lecture 4: Functions and Using the Power of Re-usability

Students implement digit-by-digit display using if/else and switch, learn functions as black boxes, create DigitsDisplay and PrintQuadType, design menu-based applications, and implement distance calculations. Emphasis is on avoiding code repetition through reusable functions.

  • C++: Function prototypes, pass-by-reference, structured modular functions
  • Python: def functions, default parameters, return values, modularized logic
Lecture 5: Divide and Conquer (Rock Paper Scissors & Stopwatch)

Students implement Rock Paper Scissors with input validation, replay loops, getch() and toupper for input simplification, display winning messages, and create a stopwatch utility. The lecture reinforces designing game loops and structured control flows.

  • C++: Console input/output, non-blocking input, game loop design, timing utilities
  • Python: Input validation, infinite loops, time module for stopwatch, clear game flow
Lecture 6: Designing Main Flows – Age Calculator

Students calculate age in years, months, and days from two dates, handle invalid entries, implement menu-based loops, display multiple clocks, and structure the main application flow using functions for modularization.

  • C++: Struct-based date handling, explicit validation, functional modularization
  • Python: datetime module for calculations, looped menus, modular functions
Lecture 7: Loops and Functions

Students learn for vs while, sequence printing, odd/even counting, sentinel-based input (-1), Fibonacci sequence implementation via Fib(N), function scoping, nested loops, and combining loops with functions for analytical tasks.

  • C++: Traditional loops, recursion or iterative Fibonacci, scoping rules
  • Python: for over range(), list comprehension, clean recursion or iteration
Lecture 8: Loops and Functions II & Shapes Printing

Implementation of IntegerSquareRoot, IsPerfectSquare, IsPrime (up to sqrt(N)), PythagoreanTriplets, Reverse, IsPalindrome, PrintASymbolKTimes, triangle patterns including hollow and equilateral triangles. Nested loops and functions are combined for pattern printing.

  • C++: Integer arithmetic, nested loops, modular functions for shapes
  • Python: List/loop-based utilities, string repetition, functional abstraction
Lecture 9: References, Pointers, and Arrays

Students explore memory through swap functions, pointer vs array semantics, dereferencing, indexing, finding min/max in arrays, and pointer arithmetic including memory addresses and element access.

  • C++: References, pointers, arrays, explicit memory operations
  • Python: Lists, object references, implicit memory handling, list operations
Lecture 10: Static Arrays

Students initialize arrays with sequences (0,1,2…), squares (0,1,4…), evens, random numbers, prime numbers, and implement searching: first/last index, frequency, distinct elements, and mode. const and Init() functions are introduced.

  • C++: Fixed-size arrays, const, manual traversal and search
  • Python: Lists, built-in search/count, random module, list comprehensions
Lecture 11: Animations

Students set up console windows, print with gotoRowCol(), system(“cls”), implement vertical/horizontal fans, adjust speed with Sleep(), draw circles via polar coordinates, and use structs like Position and arrays of Circle for stone-throwing animations.

  • C++: Console manipulation, struct-based animation, low-level timing
  • Python: Console libraries, sleep(), object-oriented animation
Lecture 12: Two-Dimensional Arrays and Application (Prison Break)

Students learn 1D vs 2D array mapping, implement matrices (add, subtract, multiply, transpose), use struct Matrix, and apply it in “Prison Break” to trace prisoner destiny from top-left to bottom-right corners.

  • C++: 2D arrays, struct-based matrices, explicit indexing
  • Python: List-of-lists, matrix operations via loops or libraries
Lecture 13: Dynamic Memory Allocation

Explores limitations of static arrays, pointers, memory segments (Code, Global, Heap, Stack), and dynamic array allocation (Print, AllocateArray, LoadArray). Students manage memory at runtime and create growable arrays.

  • C++: new/delete, pointers for dynamic arrays, manual memory management
  • Python: Lists with dynamic resizing, automatic memory management
Lecture 14: Dynamic Memory Allocation II

Students implement struct SET (name, Size, pointer array Vs), Print, LoadArray, LoadArrayFromFile, Search, UnionSet, and dynamically allocated 2D arrays (struct MATRIX). File I/O and set/matrix operations reinforce abstraction.

  • C++: Pointer-based structs, file streams, dynamic 2D arrays
  • Python: Classes, lists, file I/O, dynamic memory abstraction
Lecture 15: Conway’s Game of Life

Students implement main loop, Init(), RepopulateWorld(), DisplayWorld() with char World[Rows][Cols]. They learn nested loops, game logic evolution, neighbor rules, visualizing living/dead cells, and interactive control with mouse painting.

  • C++: 2D arrays, loop-based state updates, console rendering
  • Python: List-of-lists, iteration over grids, visualization libraries
Lecture 16A: GOMUKO – A Generalized Tic-Tac-Toe

Students implement multiplayer board, dynamic char** board, divide-and-conquer game flow, move validation, and utility functions like DoIWinHorizontally, DoIWinVertically, DoIWinDiagonally.

  • C++: Pointer-based dynamic board, function decomposition
  • Python: List-based board, modular functions, clean abstractions
Lecture 16B: GOMUKO – AI Version (Human vs Computer)

Extends the game with AI logic, move generation, evaluation, memory diagrams of heap vs stack, and file I/O for game state persistence. Students learn state-based AI programming.

  • C++: Pointer-driven state, efficient AI computations, file streams
  • Python: Object-oriented AI, heuristic evaluation, file serialization
Lecture 17: Nokia Snake Game – Project

Students implement non-blocking input (_kbhit(), getch()), design Snake struct, manage dynamic board movement, collision detection, growth, walls, food generation, modular design, and memory management.

  • C++: Structs, dynamic arrays, non-blocking console input
  • Python: Classes, lists, event-driven input handling
Lecture 18: Final Project – The Game of Chess (Phase 0)

Focuses on board and piece representation, memory requirements, 8×8 grid initialization, user input coordinates, validation for legal destination/opponent pieces, and turn management.

  • C++: 2D char board, procedural initialization, pointer-based turn tracking
  • Python: List-of-lists board, object-oriented pieces, clean validation
Lecture 19: Final Project – The Game of Chess (Phase 1)

Students will  implement movement legality, six utility functions (IsHorizontalMove, IsVerticalMove, IsDiagonalMove and their 3 respective path clear functions). Later using those 6 functions build every piece-specific checks (IsRookLegalMove, IsQueenLegalMove), a unified LEGALITYCHECK, and memory diagrams for board state.

  • C++: Function-based checks, pointer-driven board state
  • Python: Class-based pieces, modular validation functions
Lecture 20: Final Project – The Game of Chess (Phase 2)

Students will implement pawn promotion, save & exit, replay, undo, restart without saving, check, castling, checkmate, stalemate rules, and detect illegal moves (including those leaving the king in check). Integration of all modules, memory mapping, pointers, and dynamic state ensures a fully functional system.

  • C++: Pointer-based memory management, manual save/load, dynamic state tracking
  • Python: State management, serialization-based save/load, undo/replay handling

Who can join this course?

If you’re at the beginning of a BS degree in Computer Science, Software Engineering, Data Science, Machine Learning, or Artificial Intelligence at any university or affiliated college in Lahore or its vicinity, this is an excellent opportunity to build a strong foundation for your journey in this field.

About Course

Object Oriented Programming is a comprehensive one-semester course that strengthens students’ foundations in C++ programming while introducing core Object-Oriented Programming (OOP) concepts. The course begins with a revision of arrays, pointers, and structs, then gradually moves into classes, encapsulation, constructors, inheritance, polymorphism, and operator overloading. Students gain hands-on experience through real-world projects such as a text editor, calculator, chess game, and huge integer system, along with STL-based data structures and template programming. The course also covers debugging techniques, memory management, exception handling, and software design principles.
By the end of the semester, learners develop strong problem-solving skills, write well-structured OOP code, and understand how to design scalable and efficient software systems.

  • Week 1
    • Revision of control flow, functions, arrays (1D/2D), sorting, searching; pointers basics, dynamic memory allocation/deallocation, swap using pointers, memory issues
  • Week 2
    • Pointer types (const, void, mutable), generic swap; number base conversion; mapping 1D arrays to 2D/3D; random array population
  • Week 3
    • Evolution of programming; OOP concepts; ADTs; Fraction class design, header guards, constructors/destructors, encapsulation, menu-driven operations, this pointer
    • Assignment: Time class implementation, Date/Fraction/ComplexNumber Class
  • Week 4
    • static members and exception handling, try-catch, std::cerr
    • Assignment: Singleton/Multiton Design Pattern
  • Week 5
    • Operators overloading
    • String class implementation; constructors, copy constructor, conversions, subscript overloading; operator overloading, friend functions, stream operators, copy constructor vs assignment operators.
    • Project: Text Editor
  • Week 6
    • Project: Polynomial and Huge Integer Classes
  • Week 7
    • Object relationships (composition, aggregation, association), dependencies; initializer_lists
    • Project: Making A Full Library System
  • Week 8
    • Inheritance (types, access specifiers); impact of inheritance;
    • Project: Windows Forms application—calculator UI, controls, event handling + Making Minesweeper.
  • Week 9
    • Polymorphism; virtual functions; base vs derived pointers; function pointers; vtables; abstract classes; casting
  • Week 10
    • Chess Game Development (Phase I & II): board setup, memory design, validations, player input, move processing, gameplay mechanics
  • Week 11
    • Template classes and functions; growable arrays; iterators; algorithm analysis; Big-O, Big-Ω, Big-Θ
  • Week 12
    • STL overview; vectors, lists, sets, maps, adapters; STL operations; introduction to LeetCode & CodeForces
  • Week 13
    • UNITY basics; Color Switch game; prefabs; extending games to multiple levels
  • Week 14
    • 2D game development (Flappy Bird); 3D game development (Counter-Strike style mechanics)
  • Week 15
    • Final Project discussion, evaluation criteria, design review, and future extensions

Who can join this course?

If you’re at the beginning of a BS degree in Computer Science, Software Engineering, Data Science, Machine Learning, or Artificial Intelligence at any university or affiliated college in Lahore or its vicinity, this is an excellent opportunity to build a strong foundation for your journey in this field.

About Course

The Analysis of Algorithms course is designed to deeply engage you with algorithmic problem-solving techniques and the formal analysis of algorithms, combined with detailed, intense, and complex assignments that challenge your understanding at every step. Beginning with the fundamentals of algorithmic thinking and loop invariants, the course progressively covers time complexity, recursion, and the divide-and-conquer approach through real-world examples like stock investment and various sorting algorithms. Advanced topics such as graph theory, dynamic programming, and randomized algorithms are also covered in depth, leading up to critical concepts like P vs NP problems and geometric algorithms. Alongside these rigorous topics, each section is accompanied by comprehensive tutorials that guide you through the complex assignments, ensuring you grasp both the theoretical and practical aspects of algorithm design and analysis. This course is perfect for those looking to master the intricacies of algorithms and computational efficiency.

  • Week 1
    • Algorithmic Problem solving and Analysis of Algorithms
    • Loop Invariant – Iterative Codes Correctness Proof
    • Assignment: Algorithmic Problems Solving – Prune and Search, Loop Invariant
  • Week 2
    • Time Complexity (Big O, Omega, Little O and Omega, Big Theta Notation)
    • Time Complexity ( Analysis of Several Examples)
    • Assignment: Time Complexity Analysis
  • Week 3
    • Recursion Begins
    • Solving Recurrences and Master Theorem
    • Assignment: Recurrence Revision + Solve Recurrences
  • Week 4
    • Divide and Conquer I – Stock Investment Problem, Merge Sort (Recursive & Iterative)
    • Divide and Conquer II – Lower Bound of Sorting Algorithm, Karatsuba Algorithm
    • Assignment: Divide and Conquer
  • Week 5
    • Divide and Conquer III – Quick Sort (Randomized and Deterministic)
    • Pseudo-Algorithms: Stable Count Sort, Radix Sort, Bucket Sort,
    • Computing Skyline, Closest Pair Problem
    • Assignment: Divide and Conquer
  • Week 6
    • Introduction to Graphs
    • Application of DFS
  • Week 7
    • DFS and Topological Sorting and BFS and Shortest Paths Searching
    • DFS and Finding Strongly Connected Components & Heap Data Structures
    • Assignment: Graphs Representation + Strongly Connected Components
  • Week 8
    • Graphs Shortest Path, Dijkstra and Bellman-Ford, Universal Sink
    • Graphs Minimum Spanning Trees
    • Assignment 6 -I: Graphs Algorithms
  • Week 9
    • Binary Heaps
    • Lecture 18: Disk External Sort (Priority Queue Application) and Union-Find
    • Assignment 6 -II: Graphs Challenges – Applications in Practice
  • Week 10
    • Dive into Dynamic Programming I – Smart Recursion (Catalan, Fibonacci Numbers)
    • Lecture 20: Dynamic Programming II – (Largest Sum Contiguous Subarray, Longest Increasing Subsequence)
    • Assignment 7: Graphs Problems – LeetCode Challenges
  • Week 11
    • Dynamic Programming III – (Rod Cutting Problem)
    • Dynamic Programming IV – (Longest/Shortest Distance in DAG, Edit Distance, Longest Common Sequence)
  • Week 12
    • Dynamic Programming V – (Knapsack Family Set Problems)
    • Dynamic Programming VI – (Knapsack Problem Types, Matrix Chain Multiplication)
    • Assignment 8: 1D Dynamic Programming + 2D Dynamic Programming (Matrices)
  • Week 13
    • Graphs Review + Single Source (SSPP) and All Pairs Shortest Path (APSP)
    • P vs NP and Introduction to Reductions
  • Week 14
    • P vs NP and Reductions – II (Yes/NO, 3SAT is as harder as SAT Problem)
    • Geometric Algorithms – Sweep Line Algorithm and its Applications
    • Assignment: Complexity Classes and SweepLine (NP Completeness)
    • Assignment: (SweepLine and Geometric Algorithms)
  • Week 15
    • Randomized Algorithms – Hiring Problem and Randomized Quicksort
    • Number Theoretic Algorithms
    • Assignment: Complexity Classes and SweepLine (Randomization)