Teaching / Algorithms and Programming Concepts
Course
Algorithms and Programming Concepts
British University Vietnam · Year 1
A first course in thinking like a computer scientist: how to find, order and organise data, how to measure whether a program is fast, and how to solve problems that are too big to try every possibility. Each topic has one slide deck, and every code example in the slides is a real Python program. The code was run with Python 3.14 and the outputs shown on the slides are the real outputs.
Run any example with python3.14 searching.py (or the file name of the topic).
Lectures
- 1
Searching
Slides + codeLinear search, binary search, the bisect module; counting steps and timing.
- 2
Sorting
Slides + codeBubble, insertion, merge and quick sort, Timsort, and how they compare.
- 3
Big-O and complexity
Slides + codeGrowth rates, counting operations, best/worst case, measuring real programs.
- 4
Trees
Slides + codeBinary search trees, traversals, heaps and expression trees.
- 5
Graphs
Slides + codeAdjacency lists and matrices, BFS, DFS, components, Dijkstra's shortest paths.
- 6
Dynamic programming
Slides + codeMemoisation, tabulation, coin change, longest common subsequence.
- 7
Optimization
Slides + codeKnapsack (brute force, greedy, DP), hill climbing, gradient descent, TSP.