| Interactive Data Structure
Visualizations Graph Representation |
All data structures can be representing using a contiguous representation, using an array, or a linked representation. Array representations have the advantage that each element of the array is directly accessible, while linked representations are dynamic and can be expanded as needed. In this segment you will learn how an undirected graph is represented using an adjacency matrix--an array.
When you start the visualization you will notice a depiction of the undirected graph at the left and its corresponding adjacency matrix at the right. For each edge connecting two nodes, a and b, of the graph, two cells of the matrix, cell a,b and cell b,a correspond to this edge.
This segment contains two special radio buttons Graph and Matrix. If you select Graph, when you click the Make One button, a graph will be generated. When you click Create Other, that graph will be transformed into its adjacency matrix representation. If you have selected Matrix, Make One will generate an adjacency matrix, and Create Other will transform it into its corresponding graph.