VerityPrep School Support

Olympiad Algorithms & Data Structures: Book 5.1

Study algorithms for olympiads: Big-O, greedy and divide and conquer, BFS and DFS, shortest paths, network flows, NP-completeness and hash tables.

  • School Support
  • Olympics
  • Olympics
Book 5.1—Algorithm, Discrete Reasoning and Data Structure cover

About this book

This is Book 5.1 of the Math Olympiad series, a companion to the discrete mathematics book that focuses on algorithms, discrete reasoning and data structures. It suits students preparing for olympiads that reward algorithmic thinking.

The first chapter lays the foundations: what discrete mathematics is, logic and Boolean algebra, De Morgan's laws, sets, what an algorithm is, running time and Big-O, greedy algorithms, divide and conquer, and sorting, searching and optimisation.

The second chapter covers graph algorithms, including BFS and DFS traversal, minimum spanning trees, shortest paths, network flows and min-cut, matchings, and complexity with NP-completeness. The third chapter introduces data structures: abstract data types and arrays, linked lists, stacks, queues and deques, binary search trees, and hash tables and sets.

Look inside

Preview this book

Browse the full contents and read the opening topic.

Sample · 34-Book 5-1 · Chapter 34-1 · Algorithmic Strategy & Analysis (Foundations)

Chapter 34 Overview

Book 5-1 · Chapter 34-1 · Algorithmic Strategy & Analysis (Foundations)

This is the first chapter of the review book Algorithm and Discrete Reasoning. It starts from the very beginning — what discrete mathematics even is — and climbs, step by step, to the strategic ideas that make algorithms fast. We deliberately go from the simplest ideas to the most complex: first the raw material (discrete objects, logic, Boolean algebra, sets), then the machinery for reasoning about programs (what an algorithm is, and how we measure its speed with big-O), and finally the great strategy patterns (greedy, divide and conquer, searching, sorting, and optimization). Nothing is assumed; every term is defined and illustrated.

Why start with logic and sets before algorithms? Because data structures are discrete structures, and algorithms are all about discrete structures — the true/false reasoning of Boolean algebra becomes the if-conditions of code, and the union/intersection of sets becomes the operations of real programs. Building this base makes everything afterward feel obvious. The foundations follow S. Sinha, Discrete Mathematical Algorithm, and Data Structure (Leanpub, 2020–2026); the algorithm-analysis and strategy topics follow Y. Disser, Algorithmic Discrete Mathematics (TU Darmstadt, 2024). Each topic has plain-language explanations, worked examples, figures, comics, a book reference, and fully solved questions.

📚 Contents of Chapter 34-1

Read straight through — each topic builds on the previous one, simplest first.

1.1 What Is Discrete Mathematics?

1.1 What Is Discrete Mathematics?

Discrete mathematics is the study of objects that are separate and distinct — things you can count one by one, with nothing “in between.” The natural numbers \( 0,1,2,3,\dots \) are the perfect example: there is no whole number strictly between \( 2 \) and \( 3 \). This is the opposite of continuous mathematics (like calculus or the real number line), where between any two values there are infinitely many others. People, chairs, letters, and computer bits are all discrete; a smoothly sliding dimmer switch is continuous, but the individual steps of a staircase are discrete.

Why does a computer-science student begin here? Because computers are discrete machines: they store information in distinct bits (\( 0 \) or \( 1 \)) and run in distinct steps. Every data structure is a discrete structure, and every algorithm manipulates discrete structures — so discrete mathematics is quite literally the mathematics of computing. Its core toolkits — logic, sets, graphs, counting, and number theory — reappear throughout this book. A classic bridge is the Euclidean algorithm for the greatest common divisor: it works entirely with whole numbers and repeated remainders, a purely discrete process at the heart of both mathematics and cryptography.

📚 Book referenceThis follows S. Sinha, Discrete Mathematical Algorithm, and Data Structure (Leanpub, 2020–2026), Chapter 1 “Introduction to the Discourse”: what discrete mathematics is, its contrast with continuous mathematics, and its relationship to computer science (pp. 3–7).

Continue reading — 3 chapters, worked examples and practice.

Sign in to buy

Built for Olympics preparation

Topics follow the Olympics syllabus with visual explanations and worked solutions close to the lesson content.

Readable in the portal

The book opens in the VerityPrep reader with chapter navigation, search and reading controls.

Share-ready link