# Competitive Programming Syllabus

I have been searching for study material for various topics for competitive coding and i found some sort of syllabus for top competitions i thought is worth sharing

List of Topics for programming Competitions

1.Basic Geometry/Euclidean Geometry/Coordinate Geometry/ [3D
variants of everything].

1. Computational Geometry.

a. Graham Scan algorithm for Convex Hull O(n * log(n)).

b. Online construction of 3D

convex hull in O(n^2).

c. Bentley Ottmann algorithm to list all intersection points of n line segments in O((n + I) * logn).

d. Rotating Calipers Technique.

cgm.cs.mcgill.ca/~orm/rotcal.html

■ Problems Refer

the article for a list of problems which can be solved using Rotating Calipers technique.

e. Line Sweep/Plane Sweep algorithms

■Area/Perimeter of Union of Rectangles.

■ Closest pair of points.

■ Problems Follow

the tutorial for list of problems.

f. Area of Union of Circles.

g. Delayunay Triangulation of n points in O(n * logn).

h. Voronoi Diagrams of n points in O(n * logn) using Fortunes algorithm.

i. Point in a polygon problem

■O(n) solution without preprocessing.

■ O(logn) algorithm with O(n * logn) preprocessing for convex polygons.

j. Problems on computational geometry ■
BSHEEP , BULK , SEGVIS , CONDUIT , RUNAWAY , DIRVS , RAIN1 , SHAMAN , TCUTTER , LITEPIPE , RHOMBS , FSHEEP , FLBRKLIN , CERC07P , BAC ,
ALTARS , CERC07C , NECKLACE , CH3D , RECTANGL , POLYSSQ , FOREST2 , KPPOLY , RAIN2 , SEGMENTS , ARCHPLG , BALLOON , CIRCLES , COMPASS ,
EOWAMRT , ICERINK on SPOJ.

■ CultureGrowth , PolygonCover on Topcoder.

Computational Geometry: Algorithms and applications. Mark De Burg.

1. String Algorithm .

a. KnuthMorrisPratt algorithm.

■ Problems NHAY,

PERIOD on SPOJ.

Cormen chapter on Strings.

b. Aho Corasick algorithm.

■ Problems WPUZZLES
on SPOJ.

c. Suffix Arrays

■ O(n^2 * logn) Naive method of suffix array construction

■ O(n * logn^2) method of suffix array construction

■ O(n * logn) method of suffix array construction.

■ O(n) method of suffix array construction

■ O(n) LCA preprocess on Suffix Arrays to solve a variety of string problems.

d. Suffix Trees

■ O(n) construction of Suffix trees using Ukkenon’s algorithm.

■ O(n) construction of Suffix Trees if provided with Suffix Arrays using Farach’s algorithm.

e. Suffix Automata

■ O(n) Suffix Automaton construction.

f. Dictionary Of Basic Factors

■ O(n * logn) method of DBF construction using Radix Sort.

g. Manachar’s algorithm to find Lengh of palindromic substring of a string centered at a position for each position in the string.

Runtime >
O(n).

h. Searching and preprocessing Regular Expressions consisting of ‘?’, ‘*’.

i. Multidimensional
pattern matching.

j. Problems on Strings [can be solved with a variety of techniques]

DISUBSTR , PLD , MSTRING , REPEATS , JEWELS , ARCHIVER , PROPKEY , LITELANG , EMOTICON , WORDS , AMCODES , UCODES , PT07H , MINSEQ ,
TOPALIN , BWHEELER , BEADS , SARRAY , LCS , LCS2 , SUBST1 , PHRASES , PRETILE on SPOJ

1. Basic Graphs [beginner] .

a. Representation of graphs as adjacency list, adjacency matrix, incidence matrix and edge list and uses of different representations
in different scenarios.

■ problems 1.
PPATH , ONEZERO , WATER on SPOJ

c. Depth First Search.

d. Strongly Connected Components.

■ problems 1.
TOUR and BOTTOM on SPOJ.

e. Biconnected Components, Finding articulation points and bridges].

■ problems 1.
RELINETS , PT07A on SPOJ.

f. Dijkstra algorithm ■
problems 1.
SHPATH on SPOJ.

g. Floyd Warshall algorithm ■
problems 1.
COURIER on SPOJ.

h. Minimum Spanning Tree
■ problems 1.
BLINNET on SPOJ.

i. Floodfill
algorithm

j. Topological sort

k. BellmanFord
algorithm.

l. Euler Tour/Path.

■ problems WORDS1
on SPOJ.

m. Suggested reading for most of the topics in Graph algorithms ■
http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=graphsDataStrucs1 .

■ Also refer to the tutorial for problems concerning these techniques.

■ Cormen chapter 22 to 24.

1. Flow networks/ matching etc etc. [Interdiate/Advanced].

a. Maximum flow using Ford Fulkerson Method.

■ problems TAXI

, POTHOLE , IM , QUEST4 , MUDDY , EN , CABLETV , STEAD , NETADMIN , COCONUTS , OPTM on SPOJ.

b. Maximum flow using Dinics Algorithm.

■ Problems PROFIT

on spoj.

c. Minimum Cost Maximum Flow.

■ Successive Shortest path algorithm.

■ Cycle Cancelling algorithm.

d. Maximum weighted Bipartite Matching (Kuhn Munkras algorithm/Hungarian Method)

■ problems GREED

, SCITIES , TOURS on SPOJ | http://www.topcoder.com/stat?c=problem_statement&pm=8143

e. Stoer Wagner mincut
algorithm.

f. Hopcroft Karp bipartite matching algorithm.

■ problems ANGELS
on SPOJ.

g. Maximum matching in general graph (blossom shrinking)

h. GomoryHu
Trees.

■ i) Problems MCQUERY
on Spoj.

i. Chinese Postman Problem.

■ problems http://
acm.uva.es/archive/nuevoportal/data/problem.php?p=4039

eie507.eie.polyu.edu.hk/sssubmission/
B7a/

j. Suggested Reading for the full category >

■ Network flow Algorithms
and Applications by Ahuja

■ Cormen book chapter 25.

1. Dynamic Programming.

Programming(DP) as a tabulation method

■ Cormen chapter on DP

b. Standard problems (you should really feel comfortable with these types)

c. State space reduction

d. Solving in the reverse easier
characterizations looking from the end

e. Counting/optimizing arrangements satisfying some specified properties

f. Strategies and expected values

g. DP on probability spaces

h. DP on trees

6

i. DP with datastructures

j. Symmetric characterization of DP state

k. A good collection of problems

1. Greedy.

Chapter on Greedy algorithms in Cormen.

b. problems refer to the topcoder tutorial.

1. Number Theory.

a. Modulus arithmetic basic
postulates [Including modular linear equations , Continued fraction and Pell’s equation]

Chapter 1 from Number Theory for Computing by SY Yan [ Recommended ]
2. 31.1, 31.3 and 31.4 from Cormen

■ Problems

b. Fermat’s theorem, Euler Totient theorem ( totient function, order , primitive roots )

1. 1.6, 2.2 from Number Theory by SY Yan

2. 31.6 , 31.7 from Cormen

■ Problems

c. Chinese remainder theorem

1. 31.5 from Cormen

2. 1.6 from Number Theory by SY Yan

■ Problems

1. Project Euler 271

2. http://www.topcoder.com/stat?c=problem_statement&pm=10551&rd=13903

d. Primality tests ■

Deterministic O(sqrt(n) ) approach

■ Probabilistic primality tests Fermat

primality test, MillerRabin

Primality test

b. Cormen 31.8

c. 2.2 from Number Theory by SY Yan

1. Problems a.

PON, PRIC, SOLSTRAS on SPOJ

e. Prime generation techniques Sieve
of Erastothenes

■ Suggested Problems PRIME1
on SPOJ

f. GCD using euclidean method

1. 31.2 Cormen

■ Problems 1.

GCD on SPOJ

g. Logarithmic Exponentiation

h. Integer Factorization

■ Naive O(sqrt(n)) method

■ Pollard Rho factorization

1. 2.3 from Number Theory SY Yan

2. 31.9 Cormen

■ Problems 1.

i. Stirling numbers

j. Wilson theorem

■ nCr % p in O§ preprocess and O(log n ) query

k. Lucas Theorem

l. Suggested Reading for Number Theory ■

Number theory for computing by Song Y Yan [ Simple book describing concepts in details ]

■ Concepts are also superficially covered in Chapter 31 of Introduction to Algorithms by Cormen

m. Problems on Number Theory ■

1. Math (Probability, Counting, Game Theory, Group Theory, Generating functions, Permutation Cycles, Linear Algebra)

a. Probability.

Syllabus

■ Basic probability and Conditional probability

1. Suggested problems

■ Random variables, probability generating functions

■ Mathematical expectation + Linearity of expectation

1. Suggested problems

■ Special discrete and continuous probability distributions

1. Bernoulli, Binomial, Poisson, normal distribution

2. Suggested Problem

1. Cormen appendix C (very basic)

2. Topcoder probabilty tutorial http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=probabilities

3. http://en.wikipedia.org/wiki/Random_variable

4. http://en.wikipedia.org/wiki/Expected_value

5. William Feller, An introduction to probability theory and its applications

b. Counting

Syllabus

■ Basic principles Pigeon

1. Suggested problems

c. http://www.maa.org/editorial/knot/pigeonhole.html
\■ Inclusionexclusion

1. Suggested problems

■ Special numbers

eurlerian, harmonic, bernoulli, fibonnacci numbers

f. Concrete mathematics by Knuth

1. Suggested problems

counting, burnsides lemma

html

1. Suggested Problems

c. Game theory

Syllabus

■ Basic principles and Nim game

1. Sprague grundy theorem, grundy numbers

fcarcgames1

1. Suggested problems

■ Hackenbush

fcarcpartizan1

1. Suggested problems

d. Linear Algebra

Syllabus

■ Matrix Operations

1. Addition and subtraction of matrices

i. Cormen 28.1

1. Multiplication ( Strassen’s algorithm ), logarithmic exponentiation

i. Cormen 28.2

ii.Linear Algebra by Kenneth Hoffman Section 1.6

b. Problems

1. Matrix transformations [ Transpose, Rotation of Matrix, Representing Linear transformations using matrix ]

i. Linear Algebra By Kenneth Hoffman Section 3.1,3.2,3.4,3.7

b. Problems

ii.JPIX on Spoj

1. Determinant , Rank and Inverse of Matrix [ Gaussean Elimination , Gauss Jordan Elimination]

i. 28.4 Cormen

ii.Linear Algebra by Kenneth Chapter 1

b. Problems

iv.HIGH on Spoj

1. Solving system of linear equations

i. 28.3 Cormen

ii.Linear Algebra by Kenneth Chapter 1

b. Problems i.

http://www.topcoder.com/stat?c=problem_statement&pm=3942&rd=6520

1. Using matrix exponentiation to solve recurrences

b. Problems

i. REC, RABBIT1 , PLHOP on spoj

http://www.topcoder.com/stat?c=problem_statement&pm=6877

1. Eigen values and Eigen vectors

a. Problems

■ Polynomials

1. Roots of a polynomial [ Prime factorization of a polynomial, Integer roots of a polynomial, All real roots of a

polynomial ]

a. Problems

ii.POLYEQ , ROOTCIPH on Spoj

1. Lagrange Interpolation

a. Problems

e. Permutation cycles

1. Art of Computer Programming by Knuth Vol. 3

■ Problems

1. ShuffleMethod, Permutation and WordGame on topcoder.

f. Group Theory
■ Bernside Lemma, Polias theorem

a. Hernstein’s topics in algebra

html

1. Problems

a. TRANSP on spoj

b. Generating functions

1. Herbert Wilf’s generating functionology

2. Robert Sedgewick and Flajoulet’s Combinatorial analysis

10.Data Structures.

i. Basic

a. Arrays/Stacks/Queues :

■ Problems

1. CLRS: section 10.1

2. http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=dataStructures

■ Problems

1. h ttps://www.spoj.pl/problems/POSTERS/

■ Reading: CLRS: section 10.2, Mark Allen Weies Chapter 3

c. Hash Tables :

■ Problems

■ Reading: CLRS: Chapter 11, Mark Allen Weies Chapter 5

d. Circular linked list / queue

■ Problems

e. Binary/nary Trees

1. CLRS: section 10.4

2. CLRS: Chapter 12

3. Mark Allen Weies Chapter 4

4. h ttp://www.topcoder.com/tc?module=Static&d1=tutorials&d2=binarySearchRedBlack

f. Heaps

■ Problems

1. https://www.spoj.pl/problems/PRO/

2. h ttps://www.spoj.pl/problems/EXPEDI/

■ Reading : Mark Allen Weies Chapter 6

a. Trie (Keyword tree)

■ Problems

b. Interval trees / Segment Trees

■ Problems

c. Fenwick(Binary Indexed) trees

■ Problems

d. Disjoint data structures

■ Problems

1. http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=disjointDataStructure

2. Mark Allen Weies Chapter 8

e. Range minimum Query(RMQ)

■ Problems

f. Customized interval/segment trees (Augmented DS)

■ Problems

■ Reading: CLRS: Chapter 14 (augmented DS)

g. AVL Trees

■ Problems

iii. Miscellaneous (Not to be covered)

a. Splay Trees

b. B/B+ Trees

c. kd

Trees

d. Redblack

Trees

e. Skip List

f. Binomial/ Fibonacci heaps

iv. Exercices

1. https://www.spoj.pl/problems/LAZYPROG / (Hint: Heaps)t

2. https://www.spoj.pl/problems/HELPR2D2/ (Hint: Interval Trees)

3. https://www.spoj.pl/problems/SAM/ (Hint: Heaps)

4. https://www.spoj.pl/problems/PRHYME/ (Hint: Trie)

5. https://www.spoj.pl/problems/HEAPULM/ (Hint: Interval Trees)

6. https://www.spoj.pl/problems/CORNET/ (Hint: Disjoint )

7. https://www.spoj.pl/problems/EXPAND/

8. https://www.spoj.pl/problems/WPUZZLES/

9. https://www.spoj.pl/problems/LIS2/

11.Search Techniques/Bruteforce writing techniques/Randomized algorithms.

a. Backtracking [

Beginner].

■ problems >

1. N queens problems

2. Knights Tour

3. Sudoku Problem

4. Tiling Problem.

5. 15 puzzle.

b. Dancing Links and Algorithm X given by Knuth [

■ problems PRLGAME,

SUDOKU, NQUEEN on SPOJ

stanford.edu/~uno/papers/dancingcolor.

ps.gz

c. Binary Search [

Beginner].

■ poblems AGGRCOW

on SPOJ. Refer the tutorial for more problems.

■ finding all real roots of a polynomial using binary search. [intermediate].

http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=binarySearch

d. Ternary Search [

Intermediate].

■ problems 1.

http://www.spoj.pl/problems/KPPOLY/

e. Meet in the middle [Intermediate].

■ problems 1.

http://www.spoj.pl/problems/MAXISET/

g. Regular Iteration to reach a fixed point [Advanced].

■ NewtonRaphson

method to find root of a mathematical function.

■ Iterations to solve linear nonhomogeneous

system of equations.

h. Randomized Algorithms [Intermediate]■

QuickSort.

12.General programming issues in contests >

a. Arithmetic Precision [

Beginner].

http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=integersReals

Beginner].

http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=bitManipulation

■ problems refer

8 Likes

thanks for sharing

great information!!

this is awesome! thanks a ton!

can’t thank you enough!!!