Professional Documents
Culture Documents
DSA Assignment
DSA Assignment
● Graph: A data structure that consists of a finite set of vertices (nodes) and
a set of edges connecting these vertices.
● Vertex/Node: The fundamental unit in a graph, representing a point or an
entity.
● Edge: A connection between two vertices in a graph.
● Directed Graph (Digraph): A graph in which edges have a direction, i.e., an
edge (u, v) doesn't necessarily imply the existence of the reverse edge (v,
u).
● Undirected Graph: A graph in which edges have no direction, i.e., an edge
{u, v} implies the existence of the reverse edge {v, u}.
● Weighted Graph: A graph in which each edge has an associated numerical
value (weight).
● Adjacency Matrix: A two-dimensional matrix where the presence or
absence of an edge between vertices is indicated by 1 or 0, respectively.
● Adjacency List: A collection of linked lists or arrays where each list/array
represents the neighbors of a vertex.
● Cycle: A path in a graph that starts and ends at the same vertex.
● Connected Graph: A graph in which there is a path between every pair of
vertices.
● Disconnected Graph: A graph in which there are at least two vertices for
which no path exists between them.