KBTU · CSCI2105 · Fall 2026

Algorithms and Data Structures — lecture notes

One page per lab: the running order of the lecture, what to say at each beat, what goes on the board, live demos to project, and how the lab problems map back onto the material. Built from the syllabus, the lecture notes repository and the live problem sets in Polygon.

Lectures 13 Labs 12 Problems 94
Lecture 1 · Lab 1

Complexity and Memory

How the course works, the cost of an algorithm, GCD, fast powers, the sieve, factorization and the stack.

10 problems · defence Week 3
Lecture 2 · Lab 2

Linear Data Structures

Stack, queue, deque and the linked list — with bracket matching and two breadth-first searches.

10 problems · defence Week 4
Lecture 3 · Lab 3

Binary Search

Exact search, the nearest element on each side, and binary search on the answer.

11 problems · defence Week 5
Lecture 4 · Lab 4

Binary Search Tree

Insert, search and delete, the three traversals, and why balance decides the cost.

10 problems · defence Week 6
Lecture 5 · Lab 5

Heap and Heap Sort

The array-backed heap, insert and extract in O(log n), heap sort and the priority queue.

5 problems · defence Week 7
Lecture 6 · Lab 6

Bubble Sort and Quick Sort

Why there is more than one sort, bubble sort and its limits, and quick sort — pivot, partition, and the O(n²) worst case.

9 problems · defence Week 8
Lecture 7 · Lab 7

Merge Sort and Divide and Conquer

Merge sort — stable, guaranteed O(n log n) — and divide and conquer beyond sorting: inversions, quick select, maximum subarray.

5 problems · defence Week 10
Lecture 8 · Lab 8

Hashing and Rabin–Karp

The polynomial hash, prefix hashes, Rabin–Karp search, distinct substrings and collisions.

6 problems · defence Week 11
Lecture 9 · Lab 9

Prefix Function and KMP

What π[i] means, computing it in O(n), KMP with pattern + '#' + text, and periods, borders and rotations.

8 problems · defence Week 12
Lectures 10–11 · Lab 10

Graphs · BFS and DFS

Three ways to store a graph, BFS level by level, then DFS — components, bipartite check, cycles, topological sort, SCC and bridges.

10 problems · defence Week 14
Lecture 12 · Lab 11

Minimum Spanning Trees

Kruskal with disjoint set union, Prim, the cut and cycle properties.

5 problems · defence Week 15
Lecture 13 · Lab 12

Shortest Paths

Dijkstra, Bellman–Ford with negative cycles, Floyd–Warshall for all pairs.

5 problems · defence Week 15

How the semester is laid out

Lab N is published in the week its material is taught, and defended later — the syllabus calls that contest LabContest N. The gap is two weeks up to the midterm and three after it, because week 9 is the midterm and week 13 the endterm, and no defence runs in either.

Labs 11 and 12 are defended together in week 15 — that is how the syllabus lists them, as a single LabContest11-12 covering spanning trees and shortest paths.