Grokking Data Structures & Algorithms for Coding Interviews

0% completed

Introduction to Graph

A graph is a data structure used to represent relationships or connections between objects. A graph consists of two main parts:

  • Vertices (Nodes): Represent the individual objects.
  • Edges (Links): Represent the connections between those objects.

A graph is often denoted as G(V, E) where:

  • V is the set of vertices.
  • E is the set of edges connecting pairs of vertices.

Example

Consider a graph with five nodes A, B, C, D, and E, and the following connections:

This graph forms a network of connections, where you can traverse from one node to ano

.....

.....

.....

Like the course? Get enrolled and start learning!
Daehan Choi

Daehan Choi

· 2 years ago

1. Digraph

and then

3. Loop in Graph

Show 2 replies
K

Keerthana Krishnamurthy

· a year ago

Under Degree Terminology, isn't the degree of node C for the undirected graph 3? Can you please explain how the value is 4?

Show 1 reply