Programming and Data Structures
Graduate core course in Python data structures and algorithms, pairing implementation from first principles with asymptotic and amortized analysis, formal proofs, balanced trees, hashing, heaps, dynamic programming, greedy algorithms, and graph search.
Viewing Active MTech Section (Z5007): View BS Reference Archive (Z2005) ->
Open slide PDFs directly in your browser, read LaTeX lecture notes and worksheets (PDF), preview PowerPoint decks online, or download laboratory notebooks without login walls.
- W1 Week 1
Course Orientation, RAM Model & Big-O Asymptotics
Scaling motivation, duplicate detection in Python, RAM operation counting, and Big-O rules (Oct 5-9).
Readings: Canning, Broder & Lafore Ch. 1-2
- W2 Week 2
Arrays, Binary Search, Dynamic Arrays & Elementary Sorts
Contiguous byte indexing, invariant-based binary search, dynamic doubling, bubble sort, and selection sort (Oct 12-16).
Readings: Canning, Broder & Lafore Ch. 2-3
- W3 Week 3 ICA 1 (Thu Oct 22)
Insertion Sort & Stacks (Arrays vs. Linked Nodes)
Inversion bounds on insertion sort, LIFO ADT, bracket matching, and array versus linked stacks (Oct 19-22).
Readings: Canning, Broder & Lafore Ch. 3-4
- W4 Week 4
Circular Queues, Linked Lists, Sentinels & LRU Cache
Modular ring buffers, singly linked pointer updates, doubly linked sentinels, and O(1) LRU cache design (Oct 28-30).
Readings: Canning, Broder & Lafore Ch. 4-5
- W5 Week 5 ICA 2 (Thu Nov 5)
Recursion, Merge Sort, Quicksort & Master Theorem
Base cases, call stack frames, stable Merge Sort, Lomuto Quicksort and Quickselect, and recursion trees (Nov 2-6).
Readings: Canning, Broder & Lafore Ch. 6-7; CLRS Ch. 4
- W6 Week 6 Quiz 1 (Nov 12-14)
Quiz 1 Review & Practice Bank (Ch. 1-7)
Cumulative review covering Big-O, arrays, stacks, queues, linked lists, recursion, and sorting ahead of Quiz 1 (Nov 12-14).
Readings: Canning, Broder & Lafore Ch. 1-7
- W7 Week 7
Linear Sorts, Binary Trees & Binary Search Trees
Counting sort, Radix sort, binary tree properties, four traversals, BST invariants, search, insert, and 3-case deletion (Nov 16-20).
Readings: Canning, Broder & Lafore Ch. 8; CLRS Ch. 8, 12
- W8 Week 8
AVL Trees, Red-Black Trees, Heaps & Hash Tables
Self-balancing height invariants, single/double AVL rotations, binary heaps, priority queues, and open-addressing/chaining hash tables (Nov 23-27).
Readings: Canning, Broder & Lafore Ch. 8, 10, 11, 13; CLRS Ch. 11, 13
- W9 Week 9 ICA 3 (Thu Dec 3)
Graph Representations, BFS, DFS & Topological Sort
Adjacency lists vs. matrices, breadth-first levels, depth-first discovery/finish timestamps, cycle detection, and Kahn topological ordering (Nov 30-Dec 4).
Readings: Canning, Broder & Lafore Ch. 14; CLRS Ch. 20
- W10 Week 10
Shortest Paths: Dijkstra & Bellman-Ford
Edge relaxation invariants, priority-queue Dijkstra, negative-weight Bellman-Ford, negative-cycle checks, and DAG shortest paths (Dec 7-11).
Readings: Canning, Broder & Lafore Ch. 14-15; CLRS Ch. 22
- W11 Week 11
Greedy Algorithms & Minimum Spanning Trees (Kruskal & Prim)
Greedy-choice proofs, interval scheduling, Huffman coding, cut property, Kruskal MST, and Prim priority-queue MST (Dec 14-18).
Readings: Skiena Ch. 7-10; CLRS Ch. 15, 21
- W12 Week 12 Quiz 2 (Dec 22-24)
Dynamic Programming Foundations
Optimal substructure, overlapping subproblems, top-down memoization vs. bottom-up tabulation, 0/1 knapsack, coin change, and LIS (Dec 21-24).
Readings: Skiena Ch. 10; CLRS Ch. 14
- W13 Week 13
Advanced Dynamic Programming: Edit Distance, Matrix Chain & Tree DP
Sequence alignment, LCS reconstruction, matrix-chain parenthesization, bitmask states, and dynamic programming on trees.
Readings: CLRS Ch. 14; Skiena Ch. 10
- W14 Week 14 ICA 4 (Thu Jan 14)
String Matching (KMP, Rabin-Karp) & Prefix Tries
Rolling hashes, Knuth-Morris-Pratt prefix function, prefix tries for autocomplete, and pattern-matching benchmarks.
Readings: CLRS Ch. 32
- W15 Week 15
Union-Find, Path Compression & Amortized Analysis
Disjoint-set forest with union-by-rank and path compression, aggregate, accounting, and potential amortized methods.
Readings: CLRS Ch. 16, 19
- W16 Week 16
NP-Completeness, Reductions & Approximation Algorithms
P vs. NP, polynomial-time reductions (3-SAT, Clique, Vertex Cover, TSP), and bounded approximation guarantees.
Readings: CLRS Ch. 34, 35
- W17 Week 17 Practical Jan 28; Theory Feb 1-5
Capstone Synthesis, Project Vivas & Final Examinations
Full-semester synthesis spanning complexity, trees, hashing, graphs, DP, and NP reductions, pair project vivas, practical lab exam (Jan 28), and theory exam (Feb 1-5).
Readings: Canning, Broder & Lafore; CLRS; Skiena
Weekly Schedule
| Session | Frequency | Notes |
|---|---|---|
| Lectures | 4 sessions per week | Monday, Wednesday, Thursday, and Friday (Mon 9:00-9:50 AM, Wed 11:00-11:50 AM, Thu 10:00-10:50 AM, Fri 11:00-11:50 AM) |
| Laboratory | Thursday, 2:00 PM - 4:40 PM EAT | 2 hr 40 min weekly lab; four In-Class Assignments run 2:00-2:45 PM |
| Office Hours | Tuesday, 2:00 PM - 4:00 PM EAT | Room 105 (F1) or email with Z5007 in subject |
Prerequisites & Stack
Foundational Python proficiency (functions, recursion basics, loops, OOP classes, and reading Python error traces) plus discrete mathematics.
Environment: Python 3.12+ · VS Code · Jupyter / Google Colab · pytest · Git
Learning Outcomes
- 01 CLO1: Analyze the time and memory cost of algorithms using Big-O notation, recurrences, and amortized analysis.
- 02 CLO2: Implement arrays, stacks, queues, linked lists, trees, hash tables, heaps, and graphs from first principles in Python.
- 03 CLO3: Prove algorithm correctness and reason about lower bounds such as sorting n log n limits.
- 04 CLO4: Design solutions using sorting, recursion, dynamic programming, greedy algorithms, and graph search.
- 05 CLO5: Evaluate empirical performance by profiling, benchmarking, and choosing data structures with evidence.
- 06 CLO6: Apply data structures plus parallel and randomized methods to large datasets.
Assessment & Grading
Nov 12-14 (institute window) · Written closed book covering Weeks 1-5 (Ch. 1-7).
Dec 22-24 (institute window) · Written closed book covering Weeks 7-11 (Trees, Hashing, Heaps, DP, Greedy).
Thu labs 2:00-2:45 PM (Oct 22, Nov 5, Dec 3, Jan 14) · Offline auto-tested coding.
Every Thursday 2:00-4:40 PM · Best 9 of 11 graded weekly laboratory notebooks.
Nov 6 to Jan 28 · Pair engineering project with proposal, checkpoint, report, and viva.
Thu Jan 28 in lab (2 hr 40 min) · Offline coding examination across full course.
Feb 1-5 institute exam timetable · Comprehensive written closed-book examination.
Textbooks & Study Tools
- Data Structures & Algorithms in PythonRequired
John Canning, Alan Broder, and Robert Lafore (Addison-Wesley, 2022)
Core textbook followed chapter by chapter (Ch. 1-16).
- The Algorithm Design Manual (3rd ed.)Reference
Steven S. Skiena (Springer, 2020)
Dynamic programming, greedy algorithms, A* search, and randomized methods.
- Introduction to Algorithms (4th ed.)Reference
Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein (MIT Press, 2022)
Optional full proofs and formal asymptotics reference.
Interactive animations for arrays, trees, heaps, hash tables, sorting, and graphs.
Step-by-step trace tool suited for binary search trees, balanced trees, and hashing.
Line-by-line visualization of Python call stacks, recursion, and object references.
Theoretical foundations and algorithm analysis lectures.
Optional ungraded coding exercises for extra practice outside lab sessions.
Course Policies & Reuse
Attendance
Attendance is expected at all four weekly lectures and Thursday labs. Bring a charged laptop to every session.
Late Work
Late submissions lose 10% per day and are not accepted after 3 days. Notify Dr. Nyalala before the deadline for emergencies.
Academic Integrity
Discussing ideas with classmates is encouraged; sharing or copying code is prohibited. You must be able to explain every line you submit.
Use of AI Tools
AI coding assistants may be used to clarify concepts and inspect error messages, not to generate submitted lab solutions, ICA code, or written proofs.
All lecture notes, slides, and laboratory materials for Z5007 are licensed under CC BY-NC-SA 4.0 . ShareAlike required; commercial use prohibited without permission.