Skip to main content
Top

2020 | Book

Guide to Competitive Programming

Learning and Improving Algorithms Through Contests

share
SHARE
insite
SEARCH

About this book

Building on what already is the most comprehensive introduction to competitive programming, this enhanced new textbook features new material on advanced topics, such as calculating Fourier transforms, finding minimum cost flows in graphs, and using automata in string problems. Critically, the text accessibly describes and shows how competitive programming is a proven method of implementing and testing algorithms, as well as developing computational thinking and improving both programming and debugging skills.

Topics and features: introduces dynamic programming and other fundamental algorithm design techniques, and investigates a wide selection of graph algorithms; compatible with the IOI Syllabus, yet also covering more advanced topics, such as maximum flows, Nim theory, and suffix structures; surveys specialized algorithms for trees, and discusses the mathematical topics that are relevant in competitive programming; reviews the features of the C++ programming language, and describes how to create efficient algorithms that can quickly process large data sets; discusses sorting algorithms and binary search, and examines a selection of data structures of the C++ standard library; covers such advanced algorithm design topics as bit-parallelism and amortized analysis, and presents a focus on efficiently processing array range queries; describes a selection of more advanced topics, including square-root algorithms and dynamic programming optimization.

Fully updated, expanded and easy to follow, this core textbook/guide is an ideal reference for all students needing to learn algorithms and to practice for programming contests. Knowledge of programming basics is assumed, but previous background in algorithm design or programming contests is not necessary. With its breadth of topics, examples and references, the book is eminently suitable for both beginners and more experienced readers alike.

Table of Contents

Frontmatter
Chapter 1. Introduction
Abstract
This chapter shows what competitive programming is about, outlines the contents of the book, and discusses additional learning resources.
Antti Laaksonen
Chapter 2. Programming Techniques
Abstract
This chapter presents some of the features of the C\(++\) programming language that are useful in competitive programming and gives examples of how to use recursion and bit operations in programming.
Antti Laaksonen
Chapter 3. Efficiency
Abstract
The efficiency of algorithms plays a central role in competitive programming. In this chapter, we learn tools that make it easier to design efficient algorithms.
Antti Laaksonen
Chapter 4. Sorting and Searching
Abstract
Many efficient algorithms are based on sorting the input data, because sorting often makes solving the problem easier. This chapter discusses the theory and practice of sorting as an algorithm design tool.
Antti Laaksonen
Chapter 5. Data Structures
Abstract
This chapter introduces the most important data structures of the C\(++\) standard library. In competitive programming, it is crucial to know which data structures are available in the standard library and how to use them. This often saves a large amount of time when implementing an algorithm.
Antti Laaksonen
Chapter 6. Dynamic Programming
Abstract
Dynamic programming is an algorithm design technique that can be used to find optimal solutions to problems and to count the number of solutions. This chapter is an introduction to dynamic programming, and the technique will be used many times later in the book when designing algorithms.
Antti Laaksonen
Chapter 7. Graph Algorithms
Abstract
Many programming problems can be solved by considering the situation as a graph and using an appropriate graph algorithm. In this chapter, we will learn the basics of graphs and a selection of important graph algorithms.
Antti Laaksonen
Chapter 8. Algorithm Design Topics
Abstract
This chapter discusses a selection of algorithm design topics. Section 8.1 focuses on bit-parallel algorithms that use bit operations to efficiently process data. Typically, we can replace a for loop with bit operations, which may remarkably improve the running time of the algorithm.
Antti Laaksonen
Chapter 9. Range Queries
Abstract
In this chapter, we discuss data structures for efficiently processing range queries on arrays. Typical queries are range sum queries (calculating the sum of values) and range minimum queries (finding the minimum value).
Antti Laaksonen
Chapter 10. Tree Algorithms
Abstract
The special properties of trees allow us to create algorithms that are specialized for trees and work more efficiently than general graph algorithms. This chapter presents a selection of such algorithms.
Antti Laaksonen
Chapter 11. Mathematics
Abstract
This chapter deals with mathematical topics that are recurrent in competitive programming. We will both discuss theoretical results and learn how to use them in practice in algorithms.
Antti Laaksonen
Chapter 12. Advanced Graph Algorithms
Abstract
This chapter discusses a selection of advanced graph algorithms. Section 12.1 presents an algorithm for finding the strongly connected components of a graph. After this, we will learn how to efficiently solve the 2SAT problem using the algorithm.
Antti Laaksonen
Chapter 13. Geometry
Abstract
This chapter discusses algorithm techniques related to geometry. The general goal of the chapter is to find ways to conveniently solve geometric problems, avoiding special cases and tricky implementations.
Antti Laaksonen
Chapter 14. String Algorithms
Abstract
This chapter deals with topics related to string processing.
Antti Laaksonen
Chapter 15. Additional Topics
Abstract
This final chapter presents a selection of advanced algorithms and data structures. Mastering the techniques of this chapter may sometimes help you to solve the most difficult problem in a programming contest.
Antti Laaksonen
Correction to: Range Queries
Antti Laaksonen
Backmatter
Metadata
Title
Guide to Competitive Programming
Author
Dr. Antti Laaksonen
Copyright Year
2020
Electronic ISBN
978-3-030-39357-1
Print ISBN
978-3-030-39356-4
DOI
https://doi.org/10.1007/978-3-030-39357-1

Premium Partner