0% found this document useful (0 votes)
47 views22 pages

Learn Graphs in 10 Days

This document outlines a 10 day course on learning graphs. Each day covers different graph algorithms and data structures including representation, traversal, shortest paths, cycle detection, minimum spanning trees, connectivity, and advanced algorithms. Practice problems and interview questions are provided for each topic.
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)
47 views22 pages

Learn Graphs in 10 Days

This document outlines a 10 day course on learning graphs. Each day covers different graph algorithms and data structures including representation, traversal, shortest paths, cycle detection, minimum spanning trees, connectivity, and advanced algorithms. Practice problems and interview questions are provided for each topic.
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
You are on page 1/ 22

Learn

Graphs
in 10 Days
15
1 4
30
5 50 5 15
5

2 3
15

Most asked Interview Questions


Day 1
Introduction to Graphs

Topics

D Graph Representation: Understand how graphs are


represented in computer science using adjacency
matrices and adjacency lists. (see Image 1)

Practice Questions

www.bosscoderacademy.com 1
Interview Questions
(, How would you implement a graph in Python/Java/C++!
, What are the pros and cons of using an adjacency list versus
an adjacency matrix?

www.bosscoderacademy.com 2
Day 2
Graph Traversal - BFS and DFS
Topics

= Depth-First Search (DFS): A method that explores as


far as possible along each branch before backtracking.
(see Image 1)

Practice Questions

Interview Questions
} How does BFS differ from DFS in terms of implementation and
application?Ž
x} Can you detect cycles in a directed graph using DFS?

www.bosscoderacademy.com 3
www.bosscoderacademy.com 4
Day 3
Shortest Paths in Unweighted
Graphs
Topics
J Shortest Path Using BFS: Techniques for finding the
shortest path in unweighted graphs.(see Image 1)

Practice Questions

Interview Questions
Ž{ Describe an algorithm to find the shortest path in an
unweighted graph.
x{ How can you modify BFS to track the actual path between two
nodes?

www.bosscoderacademy.com 5
www.bosscoderacademy.com 6
Day 4
Shortest Paths in Weighted
Graphs - Dijkstra's Algorithm
Topics
L Dijkstra's Algorithm: A greedy algorithm for finding
the shortest paths from a source vertex to all other
vertices in a graph with non-negative weights.(see
Image 1)

Practice Questions

Interview Questions
Š— Explain Dijkstra's algorithm and how a priority queue is used.›
™— How does Dijkstra's algorithm ensure the shortest path is
found?

www.bosscoderacademy.com 7
www.bosscoderacademy.com 8
Day 5
Cycle Detection
Topics

E Cycle Detection in Directed Graphs: Using DFS to find


back edges indicating cycles.(see Image 1)

Practice Questions

Interview Questions
x€ How do you detect a cycle in an undirected graph?ˆ
r€ Describe a method to detect cycles in directed graphs.

www.bosscoderacademy.com 9
www.bosscoderacademy.com 10
Day 6
Minimum Spanning Tree (MST)
Topics

J Kruskal’s Algorithm: Builds the MST by adding edges


in order of increasing weight.(see Image 1)

Practice Questions

Interview Questions
yŠ What is the minimum spanning tree and why is it important?
‘Š Compare and contrast Prim’s and Kruskal’s algorithms.

www.bosscoderacademy.com 11
www.bosscoderacademy.com 12
Day 7
Graph Connectivity
Topics

C Strongly Connected Components: Identifying strongly


connected components in directed graphs using
Tarjan's or Kosaraju's algorithm.(see Image 1)

Practice Questions

Interview Questions
~ˆ Explain how to find connected components in an undirected
graph.
‹ˆ What are strongly connected components, and how can they
be identified?
www.bosscoderacademy.com 13
www.bosscoderacademy.com 14
Day 8
Advanced Algorithms - Network
Flow
Topics

P Ford-Fulkerson Algorithm: A method to compute the


maximum flow in a network.(see Image 1)

Practice Questions

Interview Questions
“† Describe the maximum flow problem and its applications.‹
۠ Explain the Ford-Fulkerson algorithm and how it determines
augmenting paths.
www.bosscoderacademy.com 15
www.bosscoderacademy.com 16
Day 9
Advanced Graph Algorithms
Topics
P Bellman-Ford Algorithm: Handles shortest paths in
graphs with negative weights.(see Image 1)
P Floyd-Warshall Algorithm: Computes shortest paths
between all pairs of vertices.(see Image 2)

Practice Questions

Interview Questions
¯´ How does the Bellman-Ford algorithm handle negative weight
edges?Á
«´ Describe the Floyd-Warshall algorithm and its use cases.

www.bosscoderacademy.com 17
www.bosscoderacademy.com 18
Day 10
Review and Advanced Practice
Topics

Practice Questions

Interview Questions
MS Given a complex problem description, identify which graph
algorithms to apply and describe your approach.U
DS Discuss a time when you used graph theory to solve a

real-world problem.
www.bosscoderacademy.com 19
CONCLUSION:

www.bosscoderacademy.com 20
Why

Bosscoder?
750+ Alumni placed at Top
Product-based companies.

More than 136% hike for every 



2 out of 3 working professional.

Average package of 24LPA.

Explore More

You might also like