Algorithms: For Competitive Programming
Preparing for your incoming programming contest or codinginterview? This book contains detailed explanations and source codefor algorithms used in competitive programing. Written by softwareengineers with experience in programming competitions anddeveloping high scalable systems for some of the biggest techcompanies. It covers algorithms in the areas of Graph Theory,Number Theory, Combinatorics, Dynamic Programming, Geometry, andmore. Competitive programming is frequently associated withalgorithms, but an algorithm is just a set of instructions that aregiven to the computer to solve a specific problem that has alreadybeen solved in the head of the programmer. The goal of this book isto provide two things for each algorithm, a brief description ofhow it works and a source code that implements the theory behindthe algorithm. Each section contains exercises and their respectivesolutions. Also the appendices contain problems with non-trivialsolutions that we have selected to show the reader how sometimessimple algorithms can solve complex problems, and also how simpleproblems may require a complex solution. The source code of theexercises and other algorithms in this book can be found in theGitHub page: https://github.com/Cheetos/afcp. We have writtenthis book because of our passion for algorithms, its content comesfrom trainings for programming competitions, from coaching andmentoring others, from failures and successes on tech interviews,from our experience in the tech industry, etc. We hope that youfind this book useful for your objectives, and that you enjoyreading it as much as we enjoyed writing it.