Three ways to store a graph in memory, advantages and disadvantages
One way to analyze these is in terms of memory and time complexity (which depends on how you want to access the graph). Storing nodes as objects with pointers to one another The memory complexity for this approach is O(n) because you have as many objects as you have nodes. The number of pointers (to … Read more