0% found this document useful (0 votes)
38 views3 pages

DFS-BFS Learning Problem

Graph note

Uploaded by

bipul15
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views3 pages

DFS-BFS Learning Problem

Graph note

Uploaded by

bipul15
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

This approach helps you to learn DFS/BFS easily

#define PL Problem Link


#define MA My Approach
#define MS My Solution
#define CF CodeForces Online Judge

#1. Name : A. New Year Transportation [CF]


Problem Link: https://codeforces.com/contest/500/problem/A
My Approach : DFS
My solution: https://codeforces.com/contest/500/submission/88837063

#2. Name : 11518 - Dominos 2 [UVa]


Problem Link: https://onlinejudge.org/external/115/p11518.pdf
My Approach: BFS and real-time node count
My Solution:
https://github.com/dhimanda/UVa-Online-Judge/blob/master/11518%20Dominos%202.cpp

2.2 Name: Connected Components in a Graph [HackerEarth]


Problem Link :
https://www.hackerearth.com/problem/algorithm/connected-components-in-a-graph/
My Approch: DFS and Chk visited Arreay
My Solution:
https://github.com/dhimanda/HackerEarth/blob/master/Connected%20Components%20in%20a
%20Graph.cpp

➔ 2.3 Name: Bishu and his Girlfriend [HackerEarth]


PL:
https://www.hackerearth.com/practice/algorithms/graphs/depth-first-sea
rch/practice-problems/algorithm/bishu-and-his-girlfriend/
MA: BFS and Get the shortest path and use vector pair to find the minimum
MS:
https://github.com/dhimanda/HackerEarth/blob/master/Bishu%20and%20his%20Girlfrien
d.cpp
➔ 2.4 Name: PT07Y - Is it a tree [SPOJ]
PL: https://www.spoj.com/problems/PT07Y/
MA: Run DFS and chk connected components and Node -1 = edge
MS:
https://github.com/dhimanda/SPOJ/blob/master/PT07Y%20-%20Is%20it%20a%2
0tree.cpp

➔ 2.5 Name :
PL:
MA:
MS:
3. Name : 1012 - Guilty Prince [LightOJ]
Problem Link: http://lightoj.com/volume_showproblem.php?problem=1012
My Approch: 2d grid to LIST then DFS
My Solution:
https://github.com/dhimanda/LightOJ/blob/master/1012%20-%20Guilty%20Prince.cpp
4. Name: 1238 - Power Puff Girls [LightOJ]
Problem Link: http://lightoj.com/volume_showproblem.php?problem=1238
My Approach: 2d grid to LIST then BFS
My Solution:
https://github.com/dhimanda/LightOJ/blob/master/1238%20-%20Power%20Puff%20Girls.cpp

➔ 5. Name: 10004 Bicoloring [UVa]


PL:
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page
=show_problem&problem=945
MA: DFS with two parameters with color array to track previous
MS:
https://github.com/dhimanda/UVa-Online-Judge/blob/master/UVa%2010004%2
0Bicoloring.cpp

➔ 5.1 Name: BUG LIFE - A Bug’s Life


PL: https://www.spoj.com/problems/BUGLIFE/
MA: DFS with two parameters with color array to track previous
MS:
https://github.com/dhimanda/SPOJ/blob/master/BUGLIFE%20-%20A%20Bug%E2%
80%99s%20Life.cpp
Demo

➔ X. Name :
PL:
MA:
MS:

Prepared by Dhiman Sarker Bappi

Oh, man! no one knows

You might also like