Explain Depth first search using code snippet(python) in a detail way possible