Computer Science · Intermediate
Data Structures & Algorithms
Choose the right structure for the job and reason about how fast your code runs — the ideas behind every technical interview and every slow bug.

Computer Science program
- Lessons
- 6
- Study time
- 1h 50m
- Level
- Intermediate
- Program
- Computer Science
Sign in to open the lessons
6 lessons
Lessons, files and narration open after you sign in and buy the program. One payment opens every course in it.
Sign in to open a lesson. Buying the program opens every course and lesson in it, permanently.
About this course
Two programs can both be correct and still be worlds apart in speed. This course is about telling the difference before you ship: choosing the right structure for the data you have, and reasoning about how the work grows as the data grows.
You will learn Big-O notation without the ceremony — counting what a loop costs and comparing two answers out loud — then work through the structures that appear everywhere: arrays, hash maps, stacks, queues, linked lists, trees and graphs. From there: recursion, searching, sorting, and the traversals that power maps, feeds and dependency lists.
The project is a route planner that finds the fastest path through a small map, using a graph and a search algorithm you implement yourself. It is also the best preparation for the technical interview that stands between you and most engineering jobs.
Who this is for
- You are interviewing for a developer role and the whiteboard part is the obstacle.
- You write code that works on your data and misbehaves on a client's much larger data.
- You want to compete for remote roles where algorithm screens are standard.
Before you start
- Comfortable with functions, loops, arrays and objects in any language.
- Basic Computer Science Essentials ideas help but are not required.
- Six to eight hours, with a pencil nearby for tracing.
Where it leads
- System Design & Architecture applies these choices at the scale of whole services.
- Databases & SQL relates indexes back to the same cost reasoning.
- This is the material most often asked about in interviews at banks, telcos, fintechs and remote-first companies hiring in Ghana.
Tools you will use
What you will build
- 1Your own implementations of the core data structures
- 2A timed comparison of two solutions to the same problem
- 3A recursive and an iterative version of the same traversal
- 4A route planner that finds the fastest path through a map graph
Curriculum
2 modules · 6 lessons · 1h 50m
Sign in to open each lesson
01 · Structures that fit the job
The containers you reach for every day, and what they cost.
1. Big-O without the fear
Big-O notation is not mathematics for its own sake — it is the vocabulary engineers use to argue about whether code will still work when the data grows. This lesson builds asymptotic analysis from counting actual steps: what the notation means precisely, the standard growth families and their real-world signatures, what constants and lower-order terms mean in practice, common pitfalls in reading and writing it, and how to apply it to loops, nested loops and recursive code. By the end, "this is O(n²)" will be a prediction you can test rather than a phrase you have heard.
2. Arrays, strings and two pointers
The array is the most-used container in existence because contiguous, indexed storage makes reads instant — and the same layout makes insertions at the front expensive. This lesson covers the array's cost model precisely, the in-place operations that exploit it, the two-pointer technique that collapses nested loops into single passes, string-specific patterns (sliding windows, palindromes, immutability costs), and the boundary bugs — off-by-one, mutation of the source, encoding — that show up in every array-heavy interview and production bug. Contiguity is the whole story; everything else follows from it.
3. Maps and sets: looking things up in one step
The hash table is the data structure behind JavaScript's `Map` and `Object`, Python's `dict`, Java's `HashMap` — and the reason "slow" code often becomes fast the moment an inner loop's scan is replaced by a lookup. This lesson builds hashing from first principles: how a key becomes a position, what collisions are and how they are handled, the precise cost model (average Θ(1), worst Θ(n)), what keys are legal and why equality matters, and the practical patterns — counting, deduplication, grouping, two-sum — that convert quadratic scans into linear passes. Then the failure modes: bad hash functions, mutation while keyed, and the identity-versus-value trap.
02 · Algorithms that scale
Sorting, recursion, trees and graphs — the patterns behind real systems.
1. Sorting and searching
Sorting is the preprocessing move that makes everything downstream cheaper — searching, grouping, merging and comparison all become simple on ordered data. This lesson covers the comparison-sorting lower bound and the algorithms that approach it (merge sort, quicksort, heapsort), why built-in sorts are hybrid and stable, binary search as the canonical logarithmic algorithm with all its boundary care, and the practical discipline of choosing and verifying sorts. Understanding why n log n is the floor for comparison sorts is one of the few genuinely beautiful results in the subject — and it explains every design decision in this lesson.
2. Recursion and memoization
Recursion solves a problem by solving smaller copies of itself — the most natural formulation for trees, nested structures and divide-and-conquer, and the easiest way to write a program that never terminates. This lesson covers the anatomy of correct recursion (base case, progress, trust), the call stack as a data structure, how to trace and count recursive cost, the exponential explosion of overlapping subproblems, and memoisation as the fix that turns Fibonacci from never-finishing to instant. Then the constructive side: when iteration beats recursion, tail-call shapes, and how to debug the stack when it overflows.
3. Trees, graphs and traversal
Trees and graphs are the structures for anything with relationships: file systems, hierarchies, syntax, routes, dependencies, social networks. This lesson covers the vocabulary (root, leaf, depth, degree, DAG), the two traversal families — depth-first with its stack and three orders, breadth-first with its queue and level structure — and their costs, then the algorithms built on them: search, cycle detection, topological sorting, shortest paths (BFS for unweighted, Dijkstra for weighted), and union-find for connectivity. Traversal is the skeleton key: most graph problems are "traverse and do something at each node".
6 lessons, including the a route planner that finds the fastest path through a small map project. Sign in and buy the program to open them. Create an account to track progress and earn the certificate.
Taught by a working engineer
Kwame Mensah — Staff Engineer. Every lesson is written to be used, not just watched.
A verifiable certificate
Complete every lesson and you get a certificate with a code and QR that an employer can check in seconds.
Practice in the Code Lab
Write and run code in the browser while you learn, with your work saved to your own account.
Still have a question?
Email hello@codemasterghana.com or send a message from the contact page — we answer within two working days, in English or Twi.