// We can create either a directed graph or an undirected graph according to the flag
// if the flag is false which means undirected; otherwise, it is directed
// insert vertex and return its index which will be used for insertEdge
// for example if we have A and B two vertices in the array, which are index 0, 1
// so insert the edge in edges[0][1] and edges[1][0] if it is an undirected graph
// if it is directed, only need to do edges[0][1]
// add more functions for checking if two vertices are adjacent and getVertex
// We can create either a directed graph or an undirected graph according to the flag // if the flag is false which means undirected; otherwise, it is directed // insert vertex and return its index which will be used for insertEdge // for example if we have A and B two vertices in the array, which are index 0, 1 // so insert the edge in edges[0][1] and edges[1][0] if it is an undirected graph // if it is directed, only need to do edges[0][1]
// add more functions for checking if two vertices are adjacent and getVertex