I'm planning to study CS 61B, a data structures course, using lecture videos. Before I begin, I'd like to know which math topics are actually used throughout the course. Do I need discrete math or proof-writing experience? How comfortable should I be with algebra, logarithms, combinatorics, and probability? My math background is a little weak, so if I should review anything first, I'd prefer to focus only on the essentials rather than spend a long time studying math that won't come up. I'm mainly trying to understand the minimum background needed to follow the material effectively.
4 Answers
There’s no need to front-load a huge amount of math. Big-O is the main mathematical idea, and early on it’s more about building intuition than writing formal proofs. You’ll mostly use logs, exponents, and simple algebra, while probability may only come up for ideas such as estimating hash collisions. Learning each topic when it appears in the course is completely reasonable.
Discrete math and proof skills are useful for understanding why algorithms work and for analyzing their running time, but they aren’t a prerequisite. Basic algebra, logarithms, summation notation, and a general understanding of Big-O should be enough to begin. You may encounter some counting arguments later, but there’s no need to master advanced combinatorics beforehand.
The course is much more programming-focused than math-focused. The material usually teaches the needed math as it goes, so being comfortable with Java and recursion is likely more important than knowing calculus or advanced probability. If recursion feels unfamiliar, review that along with log and exponent rules before starting. Discrete math becomes especially valuable in later algorithms and theory courses, but it shouldn’t stop you from beginning this one.
You can get by without taking discrete math first, although it definitely helps with proofs and runtime analysis. The main preparation is basic algebra plus understanding logarithms and how they connect to exponents. Combinatorics and probability tend to appear less often and usually at a fairly light level. If you review one thing, focus on log rules and why operations like binary search take logarithmic time.

Thanks, that helps a lot! I’ll start with logarithms and review the other topics as they come up.