Changed how the Visited nodes are tracked (#3811)
Updated the code to track visited Nodes with Set data structure instead of Lists to bring down the lookup time in visited from O(N) to O(1) as doing O(N) lookup each time in the visited List will become significantly slow when the graph grows
A
Akash G Krishnan committed
fa364dfd274349ab3e674ea97780a7b9977cb7ef
Parent: b55e132
Committed by GitHub <noreply@github.com>
on 11/21/2020, 6:58:52 AM