Depth First Search Algorithm Time Complexity