From 262699fc7c139739869fcf70618b572386f05db8 Mon Sep 17 00:00:00 2001 From: Rohan Janardhan <104809376+rxhxn30@users.noreply.github.com> Date: Tue, 4 Jul 2023 22:14:02 +0530 Subject: [PATCH] Update bfs-sequence.py --- algorithms/Python/graphs/bfs-sequence.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/algorithms/Python/graphs/bfs-sequence.py b/algorithms/Python/graphs/bfs-sequence.py index d50acad1..23e19208 100644 --- a/algorithms/Python/graphs/bfs-sequence.py +++ b/algorithms/Python/graphs/bfs-sequence.py @@ -1,7 +1,7 @@ """ -BFS graph using Adjecency List +BFS graph using Adjacency List ----------------------------------------------------------------------------------------- --In Breadth First Search Sequence of any graph all children of a parent node +-In Breadth-First Search Sequence of any graph all children of a parent node is visited first and the children are stored in the QUEUE array and VISITED array. -Children of nodes in QUEUE are visited one by one and stored in the QUEUE and @@ -33,7 +33,7 @@ def Display_BFS(curr:int ,Adj_Dict: dict[int, list[int]]) -> None: # displays BF queue.append(i) visited.append(i) rear+=1 - queue[front]=-1 # all nodes adjecent to curr are visited + queue[front]=-1 # all nodes adjacent to curr are visited front+=1 if front==rear: # no new node to visit return