From b8b9d899e4af812a18bc430fcca4083a403f4f12 Mon Sep 17 00:00:00 2001 From: Ghada AbdulWahab Date: Sun, 17 Apr 2022 03:34:30 +0200 Subject: [PATCH] delete this file --- .../Python/searching/Depth-first search.py | 32 ------------------- 1 file changed, 32 deletions(-) delete mode 100644 algorithms/Python/searching/Depth-first search.py diff --git a/algorithms/Python/searching/Depth-first search.py b/algorithms/Python/searching/Depth-first search.py deleted file mode 100644 index 945c4f4c..00000000 --- a/algorithms/Python/searching/Depth-first search.py +++ /dev/null @@ -1,32 +0,0 @@ -# this graph to check the algorithm -graph={ - 'S':['B','D','A'], - 'A':['C'], - 'B':['D'], - 'C':['G','D'], - 'S':['G'], -} -#function of DFS -def BFS(graph,start,goal): - Visited=[] - queue=[[start]] - while queue: - path=queue.pop() - node=path[-1] - if node in Visited: - continue - Visited.append(node) - if node==goal: - return path - else: - adjecent_nodes=graph.get(node,[]) - for node2 in adjecent_nodes: - new_path=path.copy() - new_path.append(node2) - queue.append(new_path) - - - - -Solution=BFS(graph,'S','G') -print('Solution is ',Solution) \ No newline at end of file