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. 1

    Searching

    Slides + code

    Linear search, binary search, the bisect module; counting steps and timing.

  2. 2

    Sorting

    Slides + code

    Bubble, insertion, merge and quick sort, Timsort, and how they compare.

  3. 3

    Big-O and complexity

    Slides + code

    Growth rates, counting operations, best/worst case, measuring real programs.

  4. 4

    Trees

    Slides + code

    Binary search trees, traversals, heaps and expression trees.

  5. 5

    Graphs

    Slides + code

    Adjacency lists and matrices, BFS, DFS, components, Dijkstra's shortest paths.

  6. 6

    Dynamic programming

    Slides + code

    Memoisation, tabulation, coin change, longest common subsequence.

  7. 7

    Optimization

    Slides + code

    Knapsack (brute force, greedy, DP), hill climbing, gradient descent, TSP.