Javascript – Time complexity of a BFS of a graph
I am unable to comprehend how the time complexity of the BFS of a graph is O(v+2E), where V is the number of vertices and E being the number of edges. /** * @param {number} V * @param {number[][]} adj…