What is the primary purpose of the 'visited' array in Dijkstra's algorithm?
-
To store the shortest path from the source to each vertex.
-
To keep track of which vertices have been processed.
-
To hold the distances from the source to each vertex.
-
To maintain the priority queue.