While the Facebook and Twitter examples are similar, the nature of the relationships in each example are different. Because relationships in Twitter are one-directional, we use arrows in our visual implementation, and such a graph is known as a directed graph. In Facebook, where the relationships are mutual and we use simple lines, the graph is called a non-directed graph. While a simple hash table can be used to represent a graph, a more robust object-oriented implementation can be used as well.2089 ↱
A Common-Sense Guide to Data Structures and Algorithms
Level Up Your Core Programming Skills
Jay Wengrow