Skip to content

Latest commit

 

History

History
8 lines (5 loc) · 510 Bytes

File metadata and controls

8 lines (5 loc) · 510 Bytes

Graph-data-class

This graph class is to use adajacency matrix (2D array) to create an adjacency list to represent a graph with time complexity of O(1).

This class will create a graph object, add vertices, edges, weight, and return an array of tuples where the first value of the tuple is the index of the vertex and the second value is the weight of the edge to that vertex.

Similar to this:

image