Prepare for Advanced Exam
Most top-tier companies want programmers good at Data Structures & Algorithms. Be what they’re looking for.
Become CodeChef Certified


Resources
01
Heaps (priority queue)
- Resources
- Practice Problems
- codechef.com - IPCTRAIN, editorial
- codechef.com - ANUMLA, editorial
- codechef.com - KSUBSUM, editorial
- codechef.com - RRATING, editorial
- codechef.com - TSECJ05, editorial
- spoj.com - WEIRDFN
- codechef.com - CAPIMOVE, editorial
- spoj.com - RMID2
- spoj.com - LAZYPROG
- spoj.com - EXPEDI
- acm.timus.ru
- baylor.edu - Maze Checking and Visualization
- codechef.com - MOSTDIST, editorial
02
Disjoint Set Union
- Resources
- Practice Problems
- codechef.com - GALACTIK, editorial
- codechef.com - DISHOWN, editorial
- codechef.com - JABO, editorial
- codechef.com - PARITREE, editorial
- codechef.com - FILLMTR, editorial
- B. Mike and Feet
- D. Quantity of Strings
- codechef.com - SETELE, editorial
- codechef.com - MAZE, editorial
- codechef.com - MAGICSTR, editorial
- codechef.com - MTRWY, editorial
- codechef.com - BIGOF01, editorial
- codechef.com - FIRESC, editorial
03
Segment Trees
- Resources
- Practice Problems
- spoj.com - GSS1
- spoj.com - GSS2
- codeforces.com - Classic Segment Tree (Expert Level)
- spoj.com - IOPC1207
- spoj.com - ORDERSET
- spoj.com - HELPR2D2
- spoj.com - ANDROUND
- spoj.com - HEAPULM
- spoj.com - NICEDAY
- spoj.com - YODANESS
- spoj.com - DQUERY
- spoj.com - KQUERY
- spoj.com - FREQUENT
- spoj.com - GSS3
- spoj.com - GSS4
- spoj.com - GSS5
- spoj.com - KGSS
- spoj.com - HELPR2D2
- spoj.com - BRCKTS
- spoj.com - CTRICK
- spoj.com - MATSUM
- spoj.com - RATING
- spoj.com - RRSCHED
- spoj.com - SUPPER
- spoj.com - ORDERS
- codechef.com - LEBOBBLE
- codechef.com - QUERY
- spoj.com - TEMPLEQ
- spoj.com - DISUBSTR
- spoj.com - QTREE
- spoj.com - QTREE2
- spoj.com - QTREE3
- spoj.com - QTREE4
- spoj.com - QTREE5
- Problems on segment tree with lazy propagation
- spoj.com - HORRIBLE (must do basic lazy propagation problem)
- spoj.com - LITE (a nice lazy propagation problem)
- spoj.com - MULTQ3 (another nice lazy propagation problem)
- codechef.com - CHEFD
- codechef.com - FUNAGP (a difficult lazy propagation problem.)
- RPAR (a difficult and nice lazy propagation)
- codechef.com - ADDMUL
- spoj.com - SEGSQRSS (a difficult lazy propagation problem)
- spoj.com - KGSS
- codeforces.com - C. Circular RMQ
- codeforces.com - E. Lucky Queries (must do hard problem on lazy propagation)
- codeforces.com - E. A Simple Task
- codeforces.com - C. DZY Loves Fibonacci Numbers (important problem to do, introduces some nice properties over lazy propagation)
- codeforces.com - D. The Child and Sequence
- codeforces.com - E. Lucky Array
04
Binary Index Tree (Fenwick tree)
- Resources
- Practice Problems
Please solve the problems mentioned in the above segment tree practice problems section. Note that usually, it's difficult to do range updates in binary indexed trees. Mostly, it is used for for range query and point update. However, you can check the following article for checking how some simple specific kind of range updates can be peformed on binary indexed tree (http://petr-mitrichev.blogspot.in/2013/05/fenwick-tree-range-updates.html). Note that range updates on BIT is not a part of the syllabus.
05
Trees (traversals)
- Resources
- Practice Problems
- spoj.com - TREEORD
06
Finding Lowest Common Ancestors (O(log N) solution where N is number of nodes)
- Resources
07
Depth First Search, Breadth First Search (Finding connected components and transitive closures)
- Resources
- geeksforgeeks.org - Connected Components in an undirected graph
- geeksforgeeks.org - Transitive closure of a graph
- geeksforgeeks.org - Depth First Traversal or DFS for a Graph
- iarcs.org.in - Basic Graph Algorithms
- visualgo.net - Graph Traversal
- harvard.edu - Breadth-First Search
- Practice Problems
- codechef.com - FIRESC, editorial
- spoj.com - BUGLIFE
- spoj.com - CAM5
- spoj.com - GCPC11J
- spoj.com - KFSTB
- spoj.com - PT07Y
- spoj.com - PT07Z
- spoj.com - LABYR1
- spoj.com - PARADOX
- spoj.com - PPATH ;(must do bfs problem)
- spoj.com - ELEVTRBL (bfs)
- spoj.com - QUEEN (bfs)
- spoj.com - SSORT ;(cycles in a graph)
- spoj.com - ROBOTGRI ;(bfs)
08
Shortest-path algorithms (Dijkstra, Bellman-Ford, Floyd-Warshall)
- Resources
- geeksforgeeks.org - Dijkstra’s shortest path algorithm
- Iarcs.org.in - Shortest paths
- Visualgo.net - Single-Source Shortest Paths (SSSP)
- Practice Problems
- codechef.com - DIGJUMP, editorial
- codechef.com - AMR14B, editorial
- codechef.com - INSQ15_F, editorial
- codechef.com - SPSHORT, editorial (slightly difficult dijkstra's problem.)
- codechef.com - RIVPILE, editorial
- spoj.com - SHPATH
- spoj.com - TRAFFICN
- spoj.com - SAMER08A
- spoj.com - MICEMAZE
- spoj.com - TRVCOST
- codechef.com - PAIRCLST, editorial
09
Bellman Ford Algorithm
- Resources
- geeksforgeeks.org - Dynamic Programming - Bellman–Ford Algorithm
- compprog.wordpress.com - ;One Source Shortest Path - Bellman-Ford Algorithm
- Practice Problems
- community.topcoder.com - PeopleYouMayKnow
- codeforces.com - D. Robot Control
- spoj.com - ARBITRAG - Arbitrage ;(Floyd Warshall)
- community.topcoder.com - NetworkSecurity ;(Floyd Warshall)
10
Minimum spanning tree (Prim and Kruskal algorithms)
- Resources
- algs4.cs.princeton.edu - Minimum Spanning Trees
- iarcs.org.in - Spanning trees
- visualgo.net - Spanning Tree
- Practice Problems
11
Biconnectivity in undirected graphs (bridges, articulation points)
- Resources
- Practice Problems
- uva.onlinejudge.org - Network
- icpcarchive.ecs.baylor.edu - Building Bridges
- uva.onlinejudge.org - Tourist Guide
- acm.tju.edu.cn - Network
- spoj.com - EC_P - Critical Edges
- spoj.com - SUBMERGE - Submerging Islands
- spoj.com - POLQUERY - Police Query
- codeforces.com - A. Cutting Figure
12
Strongly connected components in directed graphs
- Resources
- iarcs.org.in - Strongly connected components
- theory.stanford.edu - Strongly Connected Components
- Practice Problems
13
Topological Sorting
- Resources
- geeksforgeeks.org - Topological Sorting
- Practice Problems
14
Euler path, tour/cycle.
- Resources
- math.ku.edu - Euler Paths and Euler Circuits
- Practice Problems
- spoj.com - WORDS1
- codechef.com - CHEFPASS, editorial
- codechef.com - TOURISTS, editorial
- codeforces.com - D. New Year Santa Network
- B. Strongly Connected City
- codechef.com - PEOPLOVE
- codeforces.com - D. Tanya and Password
- codeforces.com - E. One-Way Reform
- spoj.com - GCPC11C
- spoj.com - MAKETREE
15
Modular arithmetic including division, inverse
- Resources
- codechef.com - Fast Modulo Multiplication (Exponential Squaring)
- codechef.com - Best known algos for calculating nCr % M ;(only for expert level)
16
Amortized Analysis
- ocw.mit.edu - Amortized Analysis
- wikipedia.org - Amortized Analysis
- iiitdm.ac.in - Amortized Analysis
18
Advanced Dynamic Programming
- Resources
- apps.topcoder.com - Commonly used DP state domains
- apps.topcoder.com - Introducing Dynamic Programming
- apps.topcoder.com - Optimizing DP solution
- codeforces.com - DP over Subsets and Paths
- Practice Problems
- spoj.com - HIST2 ;(dp bitmask)
- spoj.com - LAZYCOWS ;(dp bitmask)
- spoj.com - TRSTAGE ;(dp bitmask)
- spoj.com - MARTIAN
- spoj.com - SQRBR
- spoj.com - ACMAKER
- spoj.com - AEROLITE
- spoj.com - BACKPACK
- spoj.com - COURIER
- spoj.com - DP
- spoj.com - EDIST
- spoj.com - KRECT
- spoj.com - GNY07H
- spoj.com - LISA
- spoj.com - MINUS
- spoj.com - NAJKRACI
- spoj.com - PHIDIAS
- spoj.com - PIGBANK
- spoj.com - PT07X
- spoj.com - VOCV
- spoj.com - TOURIST
- spoj.com - MKBUDGET
- spoj.com - MMAXPER
- spoj.com - ANARC07G
- spoj.com - MENU
- spoj.com - RENT ;(dp with segment tree/BIT)
- spoj.com - INCSEQ ;(dp with segment tree/BIT)
- spoj.com - INCDSEQ ;(dp with segment tree/BIT)
- You can solve some advanced problems from
- codeforces.com - Dynamic Programming Type
19
Sieve of Eratosthenes
- Resources
- codechef.com - Sieve Methods
- Practice Problems
- spoj.com - TDKPRIME
- spoj.com - TDPRIMES
- spoj.com - ODDDIV ;(sieve + binary search)
- spoj.com - NDIVPHI ;O(N) prime testing algorithm)
- spoj.com - DIV ;(divisor sieve)
- codechef.com - LEVY, editorial
- codechef.com - PRETNUM, editorial
- codechef.com - KPRIME, editorial
- codechef.com - DIVMAC, editorial (segment tree with sieve)
- codechef.com - PPERM, editorial ;(a bit advanced sieve application)
Mock Test
Practice on the exact problems which had appeared in a past CodeChef Contests -
- Test 1 - https://www.codechef.com/ADMOCK01
- Test 2 - https://www.codechef.com/ADMOCK02