dependant on the implementation where n = the number of nodes in the graph
* classic implementation = O(n²)
\[while unvisited is not empty\], unvisited contains each node n so for 1 while loop, time complexity = n. nested for loop has n squared total
* other implementation like heaps = O(E + n log n), E is the number of edges and n is the number of nodes, time complexity is lowered