DS and ALGO Syllabus and MaterialLinks

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 12

Syllabus:

The syllabus for Foundation level is mentioned below:

1. Basic Data Structures: Arrays, Strings, Stacks, Queues


2. Asymptotic analysis (Big-O notation)
3. Basic math operations (addition, subtraction, multiplication, division,
exponentiation)
4. Sqrt(n) primality testing
5. Euclid’s GCD Algorithm
6. Basic Recursion
7. Greedy Algorithms
8. Basic Dynamic Programming
9. Naive string searching
10. O(n logn) Sorting
11. Binary Searching
Learning Resources:
1. Asymptotic analysis (Big-O notation)
0. Basic
0. youtube.com - Time complexity of a computer program
i. youtube.com - Big-O notation in 5 minutes - The basics
ii. youtube.com - Definition Of Big O Notation - Intro to Theoretical
Computer Science
iii. youtube.com - Algorithms Lecture 1 -- Introduction to
asymptotic notations
iv. iarcs.org.in - Measuring the efficiency of algorithms
v. runestone.academy - Particularly for Big-O notation
a. Advanced
0. rob-bell.net - A beginner's guide to Big O notation
i. youtube.com - Big O Notation, Gayle Laakman McDowell
ii. web.mit.edu - Big O notation
iii. youtube.com - Time and space complexity analysis of recursive
programs - using factorial
iv. A very nice tutorial with examples
b. Practice Problems
0. Check some MCQs on space and time complexity here.
i. You can see some problems with solutions here: Time
complexity of an algorithm
2. Arrays
0. Resources
0. codechef.com - Data Structure Tutorial: Array
i. cs.cmu.edu - Arrays
ii. geeksforgeeks.org - Arrays Data Structure
a. Practice Problems
0. codechef.com - LECANDY, editorial
i. codechef.com - CNOTE, editorial ;
ii. codechef.com - SALARY, editorial
iii. codechef.com - CHN15A, editorial
iv. codechef.com - RAINBOWA, editorial
v. codechef.com - FRGTNLNG, editorial
vi. codechef.com - COPS, editorial
3. Strings
0. Resources
0. tutorialspoint.com - C++ strings
i. guru99.com - Java strings
ii. docs.python.org - Python strings
iii. tutorialspoint.com - Python strings
iv. geeksforgeeks.org - Many string questions
a. Practice Problems
0. codechef.com - CSUB, editorial
i. codechef.com - LAPIN, editorial
4. Stack and Queue
0. Resources
0. geeksforgeeks.org - Stack Data Structure
i. geeksforgeeks.org - Introduction and Array Implementation
ii. tutorialspoint.com - Data Structures Algorithms
iii. cs.cmu.edu - Stacks
iv. viterbi-web.usc.edu - Stacks and Queues
v. cs.cmu.edu - Stacks and Queues
a. Practice Problems
0. spoj.com - JNEXT
i. spoj.com - STPAR
ii. spoj.com - ONP
iii. codechef.com - COMPILER
iv. spoj.com - MMASS
v. spoj.com - HISTOGRA
vi. codeforces.com - D. Maximum Xor Secondary
vii. spoj.com - ANARC09A
viii. codeforces.com - C. Minimal string
ix. codeforces.com - B. Alternating Current
x. codeforces.com - C. Longest Regular Bracket Sequence
5. Basic math operations (addition, subtraction,
multiplication, division, exponentiation)
0. codechef.com - A tutorial on Fast Modulo Multiplication
6. Euclid’s GCD Algorithm
0. Resources
0. youtube.com - Mycodeschool video
i. khanacademy.org - The Euclidean Algorithm
ii. geeksforgeeks.org - Example program to find gcd in c++:
7. Prime Numbers, divisibility of numbers
0. Resources:
0. Only O(sqrt(n)) algorithm for finding whether a number is a
prime, factorization of a number.
i. Finding prime factors by taking the square root
a. Practice Problems:
0. community.topcoder.com - DivisorInc
i. community.topcoder.com - Prime Polynom
ii. community.topcoder.com - Prime Anagrams
iii. community.topcoder.com - Refactoring
8. Basic Recursion
0. Resources
0. topcoder.com - An Introduction to Recursion, Part 1
i. topcoder.com - An Introduction to Recursion: Part 2
ii. geeksforgeeks.org - Recursion ;(along with questions)
iii. web.mit.edu - Recursion
iv. csee.umbc.edu - Recursion ;(Examples with exercises)
v. loveforprogramming.quora.com - Backtracking, Memoization &
Dynamic Programming
vi. byte-by-byte - Recursion for Coding Interviews
a. Practice Problems
0. codechef.com - NOKIA, editorial
i. codechef.com - TRISQ, editorial
ii. codechef.com - LFSTACK, editorial
iii. codechef.com - FICE, editorial
9. Greedy Algorithms
0. Resources
0. iarcs.org.in - Greedy Algorithms
i. iarcs.org.in - Greedy Algorithms
ii. topcoder.com - Greedy Algorithms
iii. Greedy Algorithms
a. Practice Problems
0. codechef.com - TACHSTCK, editorial
i. codechef.com - CIELRCPT, editorial
ii. codechef.com - MAXDIFF, editorial
iii. codechef.com - CHEFST, editorial
iv. codechef.com - CAKEDOOM, editorial
v. codechef.com - CLETAB, editorial
vi. codechef.com - TADELIVE, editorial
vii. codechef.com - MANYCHEF, editorial
viii. codechef.com - MMPROD, editorial
ix. codechef.com - CHEFTMA, editorial
x. codechef.com - STICKS, editorial
xi. spoj.com - BAISED
xii. spoj.com - BALIFE
xiii. spoj.com - GCJ101BB
xiv. codechef.com - FGFS
xv. codechef.com - KNPSK
xvi. codechef.com - LEMUSIC
xvii. spoj.com - ARRANGE
xviii. spoj.com - FASHION
10. Dynamic programming (Basic DP)
0. Resources
0. medium.freecodecamp.org - Demystifying Dynamic
Programming
i. iarcs.org.in - Dynamic Programming - Tiling
ii. topcoder.com - Dynamic Programming – From Novice to
Advanced
iii. illinois.edu - Dynamic Programming ;(Exercises are
recommended)
iv. codechef.com - Dynamic Programming
v. geeksforgeeks.org - Dynamic Programming ;(Contains a lot of
practice sessions)
vi. MIT OCW (Contains some Advanced topics as well)
0. Dynamic Programming I
i. Dynamic Programming II
ii. Dynamic Programming III
iii. Dynamic Programming IV
a. Practice Problems
0. codechef.com - ALTARAY, editorial
i. codechef.com - DELISH, editorial
ii. codechef.com - DBOY, editorial
iii. codechef.com - XORSUB, editorial
iv. codechef.com - GRID, editorial
v. codechef.com - TADELIVE, editorial
vi. codechef.com - FROGV, editorial
vii. codechef.com - MATRIX2, editorial
viii. codechef.com - AMSGAME2, editorial
ix. spoj.com - MDOLLS
x. spoj.com - MSTICK
xi. spoj.com - MCARDS
xii. spoj.com - MIXTURES
xiii. spoj.com - SAMER08D
xiv. spoj.com - AIBOHP
11. Naive string searching
0. Resources
0. geeksforgeeks.org - Naive Pattern Searching
12. Sorting
0. khanacademy.org
a. visualgo.net
b. iarcs.org.in
c. Merge sort
0. youtube.com - Merge sort algorithm
i. Practice Problems
codechef.com -MRGSRT
d. Quick sort
0. youtube.com - Quicksort algorithm
i. Practice Problems
codechef.com -TSORT
e. Counting sort
0. geeksforgeeks.org - Counting Sort
i. Practice Problems
0. codechef.com - TACHSTCK, editorial
i. codechef.com - STICKS, editorial
13. Binary Search
0. Resources
0. topcoder.com (Try solving problems of Simple and Moderate
level as mentioned in the end of the link)
i. codechef.com
ii. usfca.edu
iii. khanacademy.org
a. Detailed Theoretical analysis
0. cmu.edu (A theoretical analysis)
b. Problems
0. geeksforgeeks.org - Binary Search (Contains some solved
problems)
i. codechef.com - STRSUB, editorial
ii. codechef.com - ASHIGIFT, editorial
iii. codechef.com - STACKS, editorial
iv. codechef.com - DIVSET, editorial
v. codechef.com - LOWSUM, editorial
vi. codechef.com - SNTEMPLE, editorial
vii. codechef.com - SNAKEEAT, editorial
viii. codechef.com - SCHEDULE, editorial
ix. codechef.com - RIGHTTRI, editorial
x. codechef.com - FORESTGA, editorial
xi. codechef.com - CHEFHCK2,editorial
xii. spoj.com - ABCDEF
xiii. spoj.com - NOTATRI
xiv. spoj.com - SCALE
xv. spoj.com - SUMFOUR
xvi. spoj.com - SUBSUMS
xvii. spoj.com - ANARC05B
xviii. spoj.com - RENT
xix. spoj.com - PIE
xx. spoj.com - MKUHAR
xxi. spoj.com - SVADA
xxii. spoj.com - SUBS
Past Test:
Practice on the exact problems which had appeared in a past DSA Foundation level
exam:

1. Test 1 - https://www.codechef.com/FLPAST01
Mock Test:
1. Test 1 - codechef.com/FLMOCK01
2. Test 2 - codechef.com/FLMOCK02
3. Test 3 - codechef.com/FLMOCK03
4. Test 4 - codechef.com/FLMOCK04
Advanced
This level is intended to test that the one has a very good grasp of data structures and
algorithms, and can solve most problems that arise in practice. You can expect problems
from the following topics to come in the DSA exam.

Syllabus:
Everything in the Foundation Level, along with:

1. Heaps (priority queue)


2. Disjoint Set Union
3. Segment Trees
4. Binary Index Tree (Fenwick tree)
5. Trees (traversals, tree dynamic programming)
6. Finding Lowest Common Ancestors (O(log N) solution where N is number of
nodes).
7. Graph Algorithms:
0. Finding connected components and transitive closures.
a. Shortest-path algorithms (Dijkstra, Bellman-Ford, Floyd-Warshall)
b. Minimum spanning tree (Prim and Kruskal algorithms)
c. Biconnectivity in undirected graphs (bridges, articulation points)
d. Strongly connected components in directed graphs
e. Topological Sorting
f. Euler path, tour/cycle.
8. Modular arithmetic including division, inverse
9. Amortized Analysis
10. Divide and Conquer
11. Advanced Dynamic Programming problems (excluding the dp optimizations
which are added in expert level)
12. Sieve of Eratosthenes
Learning Resources:
1. Heaps (priority queue)
0. Resources
0. cs.cmu.edu
i. eecs.wsu.edu
ii. geeksforgeeks.org
iii. visualgo.net
iv. iarcs.org.in
a. Practice Problems
0. codechef.com - IPCTRAIN, editorial
i. codechef.com - ANUMLA, editorial
ii. codechef.com - KSUBSUM, editorial
iii. codechef.com - RRATING, editorial
iv. codechef.com - TSECJ05, editorial
v. spoj.com - WEIRDFN
vi. codechef.com - CAPIMOVE, editorial
vii. spoj.com - RMID2
viii. spoj.com - LAZYPROG
ix. spoj.com - EXPEDI
x. acm.timus.ru
xi. baylor.edu - Maze Checking and Visualization
xii. codechef.com - MOSTDIST, editorial
2. Disjoint Set Union
0. Resources
0. topcoder.com
i. harvard.edu
ii. ucdavis.edu
iii. visualgo.net
a. Practice Problems
0. codechef.com - GALACTIK, editorial
i. codechef.com - DISHOWN, editorial
ii. codechef.com - JABO, editorial
iii. codechef.com - PARITREE, editorial
iv. codechef.com - FILLMTR, editorial
v. B. Mike and Feet
vi. D. Quantity of Strings
vii. codechef.com - SETELE, editorial
viii. codechef.com - MAZE, editorial
ix. codechef.com - MAGICSTR, editorial
x. codechef.com - MTRWY, editorial
xi. codechef.com - BIGOF01, editorial
xii. codechef.com - FIRESC, editorial
3. Segment Trees
0. Resources
0. wcipeg.com
i. topcoder.com
ii. kartikkukreja.wordpress.com
iii. visualgo.net
iv. iarcs.org.in
a. Practice Problems
0. spoj.com - GSS1
i. spoj.com - GSS2
ii. codeforces.com - Classic Segment Tree (Expert Level)
iii. spoj.com - IOPC1207
iv. spoj.com - ORDERSET
v. spoj.com - HELPR2D2
vi. spoj.com - ANDROUND
vii. spoj.com - HEAPULM
viii. spoj.com - NICEDAY
ix. spoj.com - YODANESS
x. spoj.com - DQUERY
xi. spoj.com - KQUERY
xii. spoj.com - FREQUENT
xiii. spoj.com - GSS3
xiv. spoj.com - GSS4
xv. spoj.com - GSS5
xvi. spoj.com - KGSS
xvii. spoj.com - HELPR2D2
xviii. spoj.com - BRCKTS
xix. spoj.com - CTRICK
xx. spoj.com - MATSUM
xxi. spoj.com - RATING
xxii. spoj.com - RRSCHED
xxiii. spoj.com - SUPPER
xxiv. spoj.com - ORDERS
xxv. codechef.com - LEBOBBLE
xxvi. codechef.com - QUERY
xxvii. spoj.com - TEMPLEQ
xxviii. spoj.com - DISUBSTR
xxix. spoj.com - QTREE
xxx. spoj.com - QTREE2
xxxi. spoj.com - QTREE3
xxxii. spoj.com - QTREE4
xxxiii. spoj.com - QTREE5
b. Problems on segment tree with lazy propagation
0. spoj.com - HORRIBLE (must do basic lazy propagation
problem)
i. spoj.com - LITE (a nice lazy propagation problem)
ii. spoj.com - MULTQ3 (another nice lazy propagation problem)
iii. codechef.com - CHEFD
iv. codechef.com - FUNAGP (a difficult lazy propagation problem.)
v. RPAR (a difficult and nice lazy propagation)
vi. codechef.com - ADDMUL
vii. spoj.com - SEGSQRSS (a difficult lazy propagation problem)
viii. spoj.com - KGSS
ix. codeforces.com - C. Circular RMQ
x. codeforces.com - E. Lucky Queries (must do hard problem on
lazy propagation)
xi. codeforces.com - E. A Simple Task
xii. codeforces.com - C. DZY Loves Fibonacci Numbers (important
problem to do, introduces some nice properties over lazy
propagation)
xiii. codeforces.com - D. The Child and Sequence
xiv. codeforces.com - E. Lucky Array
4. Binary Index Tree (Fenwick tree)
0. Resources
0. topcoder.com
i. iarcs.org.in
ii. visualgo.net
a. 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
performed 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.
0. spoj.com - INVCNT
i. spoj.com - TRIPINV
5. Trees (traversals)
0. Resources
0. slideshare.net
i. iarcs.org.in
ii. berkeley.edu
a. Practice Problems
0. spoj.com - TREEORD
6. Finding Lowest Common Ancestors (O(log N) solution
where N is number of nodes)
0. Resources
0. topcoder.com
7. Depth First Search, Breadth First Search (Finding
connected components and transitive closures)
0. Resources
0. geeksforgeeks.org - Connected Components in an undirected
graph
i. geeksforgeeks.org - Transitive closure of a graph
ii. geeksforgeeks.org - Depth First Traversal or DFS for a Graph
iii. iarcs.org.in - Basic Graph Algorithms
iv. visualgo.net - Graph Traversal
v. harvard.edu - Breadth-First Search
a. Practice Problems
0. codechef.com - FIRESC, editorial
i. spoj.com - BUGLIFE
ii. spoj.com - CAM5
iii. spoj.com - GCPC11J
iv. spoj.com - KFSTB
v. spoj.com - PT07Y
vi. spoj.com - PT07Z
vii. spoj.com - LABYR1
viii. spoj.com - PARADOX
ix. spoj.com - PPATH ;(must do bfs problem)
x. spoj.com - ELEVTRBL (bfs)
xi. spoj.com - QUEEN (bfs)
xii. spoj.com - SSORT ;(cycles in a graph)
xiii. spoj.com - ROBOTGRI ;(bfs)
8. Shortest-path algorithms (Dijkstra, Bellman-Ford, Floyd-
Warshall)
0. Resources
0. geeksforgeeks.org - Dijkstra’s shortest path algorithm
i. Iarcs.org.in - Shortest paths
ii. Visualgo.net - Single-Source Shortest Paths (SSSP)
a. Practice Problems
0. codechef.com - DIGJUMP, editorial
i. codechef.com - AMR14B, editorial
ii. codechef.com - INSQ15_F, editorial
iii. codechef.com - SPSHORT, editorial (slightly difficult dijkstra's
problem.)
iv. codechef.com - RIVPILE, editorial
v. spoj.com - SHPATH
vi. spoj.com - TRAFFICN
vii. spoj.com - SAMER08A
viii. spoj.com - MICEMAZE
ix. spoj.com - TRVCOST
x. codechef.com - PAIRCLST, editorial
9. Bellman Ford Algorithm
0. Resources
0. geeksforgeeks.org - Dynamic Programming - Bellman–Ford
Algorithm
i. compprog.wordpress.com - ;One Source Shortest Path -
Bellman-Ford Algorithm
a. Practice Problem
0. community.topcoder.com - PeopleYouMayKnow
i. codeforces.com - D. Robot Control
ii. spoj.com - ARBITRAG - Arbitrage ;(Floyd Warshall)
iii. community.topcoder.com - NetworkSecurity ;(Floyd Warshall)
10. Minimum spanning tree (Prim and Kruskal algorithms)
0. Resources
0. algs4.cs.princeton.edu - Minimum Spanning Trees
i. iarcs.org.in - Spanning trees
ii. visualgo.net - Spanning Tree
a. Practice Problem
0. spoj.com - MST
i. spoj.com - NITTROAD
ii. spoj.com - BLINNET
iii. spoj.com - CSTREET
iv. spoj.com - HIGHWAYS
v. spoj.com - IITWPC4I
vi. codechef.com - MSTQS, editorial
vii. codechef.com - CHEFGAME, editorial
viii. codechef.com - GALACTIK, editorial
ix. codechef.com - GOOGOL03, editorial
x. spoj.com - KOICOST
11. Biconnectivity in undirected graphs (bridges, articulation
points)
0. Resources
0. e-maxx-eng.appspot.com - Finding Bridges in a Graph
i. iarcs.org.in - Articulation Points
ii. pisces.ck.tp.edu.tw - Articulation Points
a. Practice Problem
0. uva.onlinejudge.org - Network
i. icpcarchive.ecs.baylor.edu - Building Bridges
ii. uva.onlinejudge.org - Tourist Guide
iii. tzcoder.cn - Network
iv. spoj.com - EC_P - Critical Edges
v. spoj.com - SUBMERGE - Submerging Islands
vi. spoj.com - POLQUERY - Police Query
vii. codeforces.com - A. Cutting Figure
12. Strongly connected components in directed graphs
0. Resources
0. iarcs.org.in - Strongly connected components
i. theory.stanford.edu - Strongly Connected Components
a. Practice Problem
0. spoj.com - ANTTT
i. spoj.com - CAPCITY
ii. spoj.com - SUBMERGE
iii. codechef.com - MCO16405, editorial
iv. spoj.com - BOTTOM
v. spoj.com - BREAK
vi. community.topcoder.com - Marble Collection Game
13. Topological Sorting
0. Resources
0. geeksforgeeks.org - Topological Sorting
a. Practice Problem
0. spoj.com - TOPOSORT ;
i. codeforces.com - C. Fox And Names ;
ii. codechef.com - RRDAG, editorial
iii. spoj.com - RPLA
iv. codechef.com - CL16BF (topological sort with dp), editorial
v. spoj.com - MAKETREE
14. Euler path, tour/cycle.
0. Resources
0. math.ku.edu - Euler Paths and Euler Circuits
a. Practice Problem
0. spoj.com - WORDS1
i. codechef.com - CHEFPASS, editorial
ii. codechef.com - TOURISTS, editorial
iii. codeforces.com - D. New Year Santa Network
iv. B. Strongly Connected City
v. codechef.com - PEOPLOVE
vi. codeforces.com - D. Tanya and Password
vii. codeforces.com - E. One-Way Reform
viii. spoj.com - GCPC11C
ix. spoj.com - MAKETREE
15. Modular arithmetic including division, inverse
0. Resources
0. codechef.com - Fast Modulo Multiplication (Exponential
Squaring)
i. codechef.com - Best known algos for calculating nCr % M ;(only
for expert level)
16. Amortized Analysis
0. Resources
0. ocw.mit.edu - Amortized Analysis
i. wikipedia.org - Amortized Analysis
ii. iiitdm.ac.in - Amortized Analysis
17. Divide and Conquer
0. Resources
0. cs.cmu.edu - Divide-and-Conquer and Recurrences
i. geeksforgeeks.org - Divide-and-Conquer
a. Practice Problem
0. codechef.com - MRGSRT, editorial
i. spoj.com - HISTOGRA
ii. codechef.com - TASTYD, editorial
iii. codechef.com - RESTPERM, editorial
iv. codechef.com - ACM14KP1, editorial
18. Advanced Dynamic Programming problems (excluding the dp
optimizations which are added in expert level, Please go
through the basic DP resources and problems mentioned in
foundation level resource.)
0. Resources
0. apps.topcoder.com - Commonly used DP state domains
i. apps.topcoder.com - Introducing Dynamic Programming
ii. apps.topcoder.com - Optimizing DP solution
iii. codeforces.com - DP over Subsets and Paths
a. Problems for Advanced DP
0. spoj.com - HIST2 ;(dp bitmask)
i. spoj.com - LAZYCOWS ;(dp bitmask)
ii. spoj.com - TRSTAGE ;(dp bitmask)
iii. spoj.com - MARTIAN
iv. spoj.com - SQRBR
v. spoj.com - ACMAKER
vi. spoj.com - AEROLITE
vii. spoj.com - BACKPACK
viii. spoj.com - COURIER
ix. spoj.com - DP
x. spoj.com - EDIST
xi. spoj.com - KRECT
xii. spoj.com - GNY07H
xiii. spoj.com - LISA
xiv. spoj.com - MINUS
xv. spoj.com - NAJKRACI
xvi. spoj.com - PHIDIAS
xvii. spoj.com - PIGBANK
xviii. spoj.com - PT07X
xix. spoj.com - VOCV
xx. spoj.com - TOURIST
xxi. spoj.com - MKBUDGET
xxii. spoj.com - MMAXPER
xxiii. spoj.com - ANARC07G
xxiv. spoj.com - MENU
xxv. spoj.com - RENT ;(dp with segment tree/BIT)
xxvi. spoj.com - INCSEQ ;(dp with segment tree/BIT)
xxvii. spoj.com - INCDSEQ ;(dp with segment tree/BIT)
xxviii. You can solve some advanced problems from
xxix. codeforces.com - Dynamic Programming Type
19. Sieve of Eratosthenes
0. Resources:
0. codechef.com - Sieve Methods
a. Practice Problems
0. spoj.com - TDKPRIME
i. spoj.com - TDPRIMES
ii. spoj.com - ODDDIV ;(sieve + binary search)
iii. spoj.com - NDIVPHI ;O(N) prime testing algorithm)
iv. spoj.com - DIV ;(divisor sieve)
v. codechef.com - LEVY, editorial
vi. codechef.com - PRETNUM, editorial
vii. codechef.com - KPRIME, editorial
viii. codechef.com - DIVMAC, editorial (segment tree with sieve)
ix. codechef.com - PPERM, editorial ;(a bit advanced sieve
application)
20. General
0. Stanford Algoriths 1
a. Stanford Algoriths 2
Past Test:
Practice on the exact problems which had appeared in a past Advanced level exam:

1. Test 1 - https://www.codechef.com/ALPAST01
Mock Test:
1. Test 1 - https://www.codechef.com/ADMOCK01

You might also like