1/8
Finals Topic
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
Graph
Is a non-linear data structure consisting of nodes and edges.
A pictorial representation of a set of objects where some pairs of objects are connected by links. The interconnected objects are represented by points termed as vertices, and the links that connect the vertices are called edges

Vertex
Each node of the graph is represented as a _
Edge
An _ represents a path between two vertices or a line between two vertices
Adjacency
Two nodes or vertices are _ if they are connected to each other through an edge
Path
Represents a sequence of edges between the two vertices.
Adjacency Matrix
It is a 2D array of size V x V where V is the number of vertices in a graph.
The _ for the undirected graph is always symmetric/
It is also used to represent weighted graphs.

Adjacency List
An array of lists is used in the _ type of graph representation. The size of the array is equal to the number of vertices.

Breadth First Search (BFS)
This algorithm is used to search a graph data structure for a node that meets a set of criteria. It starts at the root of the graph and visits all nodes at the current depth level before moving on to the nodes at the next depth level.
We divide the vertices into two categories: Visited and Unvisited.
Uses a queue data structure for traversal.

Depth First Search (DFS)
It an algorithm for traversing or searching tree or graph data structures. The algorithm starts at the root node (selecting some arbitrary node as the root node in the case of a graph) and explores as far as possible along each branch before backtracking.
Uses Stack data structure
