s

Total Programs :- 7

Graph Representation Using Adjacency Matrix

•Create an array, size equal to No. of vertices
•Add edge
•Remove edge
•Print the graph

Checkout here...

Graph Representation Using Adjacency List

•Create an dynamic array, size equal to No. of vertices
•Add edge
•Remove edge
•Print the graph

Checkout here...

Breadth First Traversal

•Collections module is used
•Keep record of visited node
•proceeds level by level
•Check is it following BFT

Checkout here...

Depth First Traversal

•Follows first a path form the starting to the ending node, keep doing this
•Keep record of visited node
•Check is it following DFT

Checkout here...

Prim's Algorithm

•A greedy algorithm
•Start from one vertex and keep adding edges
•Until we get minimum spanning tree

Checkout here...

Kruskal's algorithm

•A greedy algorithm
•Start from the edges with the lowest weight and keep adding edges
•Edge create cycle, reject it
•Until we get the goal

Checkout here...

Dijkstra's Algorithm

•To find the shortest path between any two vertices of a graph
•Uses a greedy approach

Checkout here...

Time to Connect

copyright ©2021

Arpit Somani