Study
All courses
CSC-301 Computer Science · 300 levelInformation Technology · 200 level

Data Structures and Algorithms

Data Structures

6 units · 25 lessons · about 5 hours of reading

Start the course First: Primitive Types and Data in Memory

The route

Lessons are in the order that makes each one easier than the last. Each unit ends with a short quiz.

  1. 0/5
    Unit 1

    Foundations, Complexity and Design

    Types and memory, abstract data types, big-O and growth classes, recursion and recurrences, and the OOP patterns used to build data structures.
    1. Primitive Types and Data in MemoryFree A variable is not a box with a name. It is an address and a set of rules for reading what is there. 12 min
    2. Abstract Data Types and the Structure Taxonomy First decide what the structure promises. Only then decide how the bytes will sit. 11 min
    3. Big-O Notation and Growth Classes Big-O is not about seconds. It is about how the work grows when the input grows. 13 min
    4. Recursion and Recurrence Relations Recursion is a function calling itself on a smaller problem — and big-O needs a machine for when the calls multiply. 14 min
    5. OOP Concepts and Design Patterns in Data Structures The best containers hide their internals. Patterns are how libraries keep that promise at scale. 12 min
    6. Unit 1 quiz5 questions on this unit 6 min
  2. 0/4
    Unit 2 Full plan

    Arrays, Records, Matrices and Strings

    Address arithmetic, dynamic arrays and sparse matrices, records and C pointers, and string representation and pattern processing.
    1. Arrays and Address Arithmetic An array is not a list. It is one block of memory and a formula for finding the nth element. 12 min
    2. Dynamic Arrays, Matrices and Sparse Matrices Arrays are born full-sized. Dynamic arrays are the polite lie: they grow exactly when they must. 13 min
    3. Records, Structs and Pointers in C A record groups different types under one name — and a pointer is just an address wearing a type. 12 min
    4. Strings and String Pattern Processing The most-used structure in programming is an array with a hidden length problem. 12 min
    5. Unit 2 quiz5 questions on this unit 6 min
  3. 0/5
    Unit 3 Full plan

    Linked Lists, Stacks and Queues

    Singly, doubly and circular linked lists, LIFO stacks for brackets and expressions, and FIFO queues and circular buffers.
    1. Pointers, References and the Singly Linked List A linked list trades address arithmetic for address holding: slower to reach a position, free to insert one. 12 min
    2. Doubly Linked Lists, Circular Lists and Reversal Two pointers cost you one. A circular list costs you the sense that there is an end. 13 min
    3. Stacks: Last In, First Out A stack is the data structure the machine itself uses, which is why recursion and function calls feel the same. 12 min
    4. Infix, Postfix and Prefix Expression Evaluation Computers do not love parentheses. They love stacks. 14 min
    5. Queues, Circular Buffers and Deques A queue is fair. A circular queue is a queue that does not leak the space it has already used. 14 min
    6. Unit 3 quiz5 questions on this unit 6 min
  4. 0/4
    Unit 4 Full plan

    Trees, Heaps and Hashing

    Binary trees and traversals, binary search trees, heaps and balanced trees, and hash tables with chaining and linear probing.
    1. Binary Trees and Their Traversals A traversal is a definition, not a loop. Recursion writes it in three lines and the machine supplies the stack. 14 min
    2. Binary Search Trees A search tree is an ordered structure disguised as a tree. Its speed is the height, and its height is the order of insertion. 12 min
    3. Heaps, Priority Queues and Balanced Trees A heap is a tree with one promise instead of many, which is why it is fast and why it is stored in an array. 12 min
    4. Hash Tables and Collision Resolution A hash function turns a key into an index, so the cost of a lookup is the cost of the collision handling. 13 min
    5. Unit 4 quiz5 questions on this unit 6 min
  5. 0/4
    Unit 5 Full plan

    Searching, Sorting and Graphs

    Linear, binary and jump search, elementary and divide-and-conquer sorts, and graphs with BFS and DFS.
    1. Linear, Binary and Jump Search Binary search is not "faster". It is faster only when the data is sorted — and sorting costs more than the search saves if you search once. 14 min
    2. Elementary Sorts — Bubble, Selection and Insertion Three O(n²) sorts, three different costs inside the class — and the one you will actually use. 13 min
    3. Merge Sort, Quick Sort, Bucket and Radix Sort Merge sort and quicksort both split the problem, and they divide the work between themselves. 15 min
    4. Graphs — Representations, BFS and DFS A graph is the shape of any relationship that is not a chain and not a tree: roads, friendships, the web. 15 min
    5. Unit 5 quiz5 questions on this unit 6 min
  6. 0/3
    Unit 6 Full plan

    Runtime Storage, Compression and Synthesis

    Stack and heap lifetimes, garbage collection, Huffman coding and run-length encoding, and choosing a structure for a workload.
    1. Runtime Storage: Stack, Heap and Lifetime Stack memory is freed for you and heap memory is not, and almost every memory bug comes from mixing up which is which. 12 min
    2. Garbage Collection and Data Compression A garbage collector frees heap memory for you; Huffman coding builds the smallest codes for the most common letters. 14 min
    3. Choosing a Structure — Full-Course Synthesis The right structure is the one whose expensive operation is the one you do least. 14 min
    4. Unit 6 quiz5 questions on this unit 6 min

Practise and remember