array-based and list-based implementations of graph theory problems