August 2024
Intermediate to advanced
516 pages
11h 47m
English
A graph is a data structure that specializes in relationships, as it easily conveys how data is connected.
Here’s a visualization of our social network, displayed as a graph:

Each person is represented by a node, and each line indicates a friendship with another person. If you look at Alice, for example, you can see that she is friends with Bob, Diana, and Fred since her node has lines that connect to their nodes.
You might have noticed that graphs look similar to trees, which we’ve dealt with in the past few chapters. Indeed, trees are a type of graph. Both data structures consist of nodes connected to each other.
So what’s ...
Read now
Unlock full access