TIME COMPLEXITY!

what is the Time Complexity of HAS PATH function??

Hi @guptadev354,
It will be O(V+E) where is V is the number of vertex and E is the number of edges. The algorithm traverses all the neighbouring vertices of a parent vertex and in the worst case will traverse all the edges of the graph.