CPS Level - 02 Class Links
CPS Level - 02 Class Links
My Profiles :
Facebook ID : https://www.facebook.com/shahriar76
Codeforces Handle : http://codeforces.com/profile/_Muhammad
Stopstalk profile : https://www.stopstalk.com/user/profile/Muhammad
Medium : https://shahriar76.medium.com/
LinkedIn : https://www.linkedin.com/in/muhammad-shahriar/
🎯 Discussed topics:
1) Recursive function
2) Factorial
3) Fibonacci using recursion
4) Recursive tree
5) Basic dynamic programming ( dp )
6) Fibonacci using dp
7) Dp state, Time & memory complexity calculation of dp.
8) LOJ 1006 - Hex-a-bonacci
🎯 Task link :
🎯 References:
1) http://www.lightoj.com/volume_showproblem.php?problem=1006
1) https://sites.google.com/site/smilitude/recursion_and_dp
2) http://www.shafaetsplanet.com/?p=1022
🎯 Discussed topics:
1) Introduction to graph theory
2) Some example problems
3) What is a graph?
4) directed & undirected graph
5) Weighted & unweighted graph
6) Path & Cycle in a graph
7) Tree
8) What is a Binary tree?
9) Child, parent, siblings and subtree in a tree
10) Graph representation using Adjacency matrix.
🎯 References:
1) http://www.shafaetsplanet.com/?p=143
2) http://www.shafaetsplanet.com/?p=184
Class 2: Adjacent Matrix, Adjacent List
Class Link: https://youtu.be/GMWsHXcR5Xg
🎯 Discussed topics:
1) Adjacent matrix and implementation
2) Adjacent matrix memory and multigraph problem
3) Adjacent list and implementation.
4) Solving memory and multigraph problem of adjacent matrix
5) Adjacent list for weighted graph
6) Brief discussion of vector, pair and vector of pairs.
🎯 Discussed Problems:
1) Take input adjacency matrix :
https://paste.ubuntu.com/p/5CJjJXqx9H/
2) Take input 2D grids :
https://paste.ubuntu.com/p/6yMbN92JDy/
3) Take input adjacency list (unweighted ) :
https://paste.ubuntu.com/p/dkXrGJB4fR/
4) Take input adjacency list ( weighted ) :
https://paste.ubuntu.com/p/KVBKJPGsR4/
🎯 Class Task:
https://docs.google.com/document/d/1fcrY-h1TnEVLPNlDrii3d0D7mWp-OJbLEnTInAsBtno/edit
?usp=sharing
🎯 References:
1) http://www.shafaetsplanet.com/?p=184
2) http://www.shafaetsplanet.com/?p=211
Class 3: Graph Traversal Using Depth First Search
Class Link: https://youtu.be/cY6HJhUVwpA
🎯 Discussed topics:
1) Graph traversal using depth first search
2) What is connected component in a graph
🎯 Discussed Problems:
1) Depth first search (Dfs)
https://paste.ubuntu.com/p/4RWT5Nsvz9/
🎯 Class Task:
1) Given the undirected graph in google classroom you have to simulate dfs in it using pen and
paper and submit the picture of it.
2) Think of bellow problems (I will discuss these problems in next class InShaALLAH ) :
i) Given an undirected graph find the number of connected components in it.
ii) Given an undirected graph find the maximum size of the connected component in it.
🎯 References:
1) http://www.shafaetsplanet.com/?p=973
2) Competitive programming 3 book, depth first search section.
Class 4: Finding connected components of graph and
bi-coloring a bipartite graph
Class Link: https://youtu.be/4Hq7CbMul_A
🎯 Discussed topics:
1) Counting number components in a graph
2) Getting maximum size of connected component in a graph
3) Bicoloring a bipartite graph using dfs
4) Connected Components in a Graph ( Hacker earth ) Using number of connected components
in a graph.
Link : https://www.hackerearth.com/problem/algorithm/connected-components-in-a-graph/
5) B. DZY Loves Chemistry ( Codeforces ) Using number of connected components in a graph.
Link : https://codeforces.com/problemset/problem/445/B
6) 1009 - Back to Underworld ( Lightoj ) Using Bicoloring a bipartite graph.
Link : http://lightoj.com/volume_showproblem.php?problem=1009
🎯 Discussed Problems:
1) Connected Components in a Graph ( Hacker earth )
https://paste.ubuntu.com/p/jZpn9bxqky/
2) B. DZY Loves Chemistry ( Codeforces )
https://codeforces.com/contest/445/submission/83618995
3) 1009 - Back to Underworld ( Lightoj )
https://paste.ubuntu.com/p/MTg8hM6s8S/
🎯 Class Task:
1) Connected Components in a Graph ( Hacker earth ) Using number of connected components
in a graph.
Link : https://www.hackerearth.com/problem/algorithm/connected-components-in-a-graph/
2) B. DZY Loves Chemistry ( Codeforces ) Using number of connected components in a graph.
Link : https://codeforces.com/problemset/problem/445/B
3) 1009 - Back to Underworld ( Lightoj ) Using Bicoloring a bipartite graph.
Link : http://lightoj.com/volume_showproblem.php?problem=1009
More problems for practice :
1) https://codeforces.com/problemset/problem/277/A
2)
https://www.hackerearth.com/practice/algorithms/graphs/depth-first-search/practice-problems
/algorithm/bishu-and-his-girlfriend/
3)
https://www.hackerearth.com/practice/algorithms/graphs/breadth-first-search/practice-proble
ms/algorithm/monk-and-the-islands/
4) 459 - Graph Connectivity ( Uva )
🎯 References:
1) https://cp-algorithms.com/graph/search-for-connected-components.html
2) Competitive programming 3 book, Finding connected component section
🎯 Discussed topics:
1) Lightoj : 1012 - Guilty Prince
2) breadth first search
3) Single source shortest path.
4) Hacker earth : Monk and the Islands
🎯 Discussed Problems:
1) Lightoj : 1012 - Guilty Prince
Link : https://paste.ubuntu.com/p/QCTJ8gTNJ8/
2) Hacker earth : Monk and the Islands
Link : https://paste.ubuntu.com/p/hb3HSJz84w/
🎯 Class Task:
1) Lightoj : 1012 - Guilty Prince
Link : http://www.lightoj.com/volume_showproblem.php?problem=1012
2) Hacker earth : Monk and the Islands
Link :
https://www.hackerearth.com/practice/algorithms/graphs/breadth-first-search/practice-proble
ms/algorithm/monk-and-the-islands/description/
3) Hacker earth : Bishu and his Girlfriend
Link :
https://www.hackerearth.com/practice/algorithms/graphs/depth-first-search/practice-problems
/algorithm/bishu-and-his-girlfriend/
More problems for practice :
1) Uva 336 - A Node Too Far
2)
https://www.hackerearth.com/practice/algorithms/graphs/breadth-first-search/practice-proble
ms/
3) https://codeforces.com/problemset?order=BY_SOLVED_DESC&tags=dfs+and+similar
4)
http://www.lightoj.com/volume_problemcategory.php?&category=Breadth%20First%20Search/D
epth%20First%20Search
5) https://cses.fi/problemset/list/ ( Go to “Graph Algorithms” section )
🎯 References:
1) http://www.shafaetsplanet.com/?p=604
2) https://cp-algorithms.com/graph/breadth-first-search.html
3) Competitive programming 3 book, Breadth first search section
🎯 Discussed topics:
1) Printing shortest path using bfs ( Unweighted graph )
2) checking is a graph is bicolorable or not
3) Traversing and calculation levels of a tree using dfs
4) Multiple source bfs.
5) uva-10004
6) uva-762
7) Light Oj - 1175
🎯 Discussed Problems:
1) Printing shortest path using bfs
Link : https://paste.ubuntu.com/p/RXfPD3m49F/
2) uva-10004
Link : https://paste.ubuntu.com/p/QhNrbyHQc5/
3) uva-762
Link : https://paste.ubuntu.com/p/3f7Xj3Jtp7/
4) Traversing and calculation levels of a tree using dfs
Link : https://paste.ubuntu.com/p/2NWyfT9rnj/
5) http://www.lightoj.com/volume_showproblem.php?problem=1175
Link : https://paste.ubuntu.com/p/c8Ptjj2qYT/
🎯 Class Task:
1) uva-10004
Link : https://vjudge.net/problem/uva-10004
2) uva-762
Link : https://vjudge.net/problem/uva-762
3 ) Light Oj - 1175
Link : http://www.lightoj.com/volume_showproblem.php?problem=1175
🎯 Discussed topics:
1) Introduction to dynamic programming
🎯 Discussed Problems:
2 ) Frog 1 (Atcoder)
Link : https://atcoder.jp/contests/dp/tasks/dp_a
My Code: https://paste.ubuntu.com/p/gF6TPYKfpV/
2) Frog 2 (Atcoder)
Link : https://atcoder.jp/contests/dp/tasks/dp_b
My Code : https://paste.ubuntu.com/p/9wyMP56Pd3/
🎯 Class Task:
All the problems discussed in class are class tasks.
Class 8: Dynamic Programming Practice Problem
Class Link: https://youtu.be/VNOJYHvkzuU
🎯 Discussed topics:
1) Dynamic programming
🎯 Discussed Problems:
1) Vacation (Atcoder)
Link : https://atcoder.jp/contests/dp/tasks/dp_c
My Code : https://paste.ubuntu.com/p/YR6vGRFSZz/
🎯 Class Task:
All the problems discussed in class are class tasks.
🎯 Discussed topics:
1) Dynamic Programming
2) Knapsack 1 (Atcoder)
Link : https://atcoder.jp/contests/dp/tasks/dp_d
My Code : https://paste.ubuntu.com/p/DmdS54xhQT/
Similar Practice Problems :
1) Sudden Tour! (Toph Selise Coding Challenge)
Link :
https://toph.co/arena?contest=selise-coding-challenge-2020#!/p/5f3ff5e8c669930001b0f93
0
2) KNAPSACK - The Knapsack Problem (Spoj)
Link : https://www.spoj.com/problems/KNAPSACK/
🎯 Discussed Problems:
1) Vacation (Atcoder)
Link : https://atcoder.jp/contests/dp/tasks/dp_c
My Code : https://paste.ubuntu.com/p/YR6vGRFSZz/
🎯 Class Task:
All the problems discussed in class are class tasks.
Class 9 : Dynamic Programming Practice Problem Part -2
Class Link: https://youtu.be/Oquz9HqKqWc
🎯 Discussed topics:
1) Dynamic programming.
2) Uva 1213 - Sum of Different Primes
3) 10616 - Divisible Group Sums
🎯 Discussed Problems:
1) Uva 1213 - Sum of Different Primes
Link : https://paste.ubuntu.com/p/htKyXfZsKs/
2) 10616 - Divisible Group Sums
Link : https://paste.ubuntu.com/p/3ccBwZyNdT/
🎯 Class Task:
1) Uva 1213 - Sum of Different Primes
2) 10616 - Divisible Group Sums
🎯 Discussed topics:
1) Dp solution print
2) https://codeforces.com/contest/1341/problem/D
Solution: https://codeforces.com/contest/1341/submission/86338463
🎯 Discussed Problems:
1) Vacation (Atcoder)
Link : https://atcoder.jp/contests/dp/tasks/dp_c
My Code : https://paste.ubuntu.com/p/YR6vGRFSZz/
🎯 Class Task:
Link : https://codeforces.com/contest/1341/problem/D
Class 11: Coin Change Practice Problems
Class Link: https://youtu.be/xYuVRF8TYTY
🎯 Discussed topics:
1) Coin Change
🎯 Discussed Problems:
1) https://vjudge.net/problem/uva-357
My code : https://paste.ubuntu.com/p/DxrJZ9MgGH/
2) https://vjudge.net/problem/uva-11137
My code : https://paste.ubuntu.com/p/xhnJNFdGhB/
🎯 Class Task:
1) https://vjudge.net/problem/uva-357
2) https://vjudge.net/problem/uva-11137
3) https://leetcode.com/problems/minimum-cost-for-tickets/
🎯 Discussed topics:
1) Coin Change
🎯 Discussed Problems:
Discussed topics :
1) https://leetcode.com/problems/coin-change-2/
My code : https://paste.ubuntu.com/p/xn5Kqqb78G/
2) https://leetcode.com/problems/minimum-cost-for-tickets/
My code : https://paste.ubuntu.com/p/mnm89GdwBg/
3) https://www.hackerrank.com/challenges/coin-change/problem
My Code : https://paste.ubuntu.com/p/5BVkXhRWn6/
🎯 Class Task:
1) https://leetcode.com/problems/coin-change-2/
2) https://leetcode.com/problems/minimum-cost-for-tickets/
3) https://www.hackerrank.com/challenges/coin-change/problem
4) http://www.lightoj.com/volume_showproblem.php?problem=1231