Skip to content

Commit 728c0df

Browse files
Fix typo: Adjancent -> Adjacent (TheAlgorithms#2184)
1 parent 367f8ce commit 728c0df

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

graphs/breadth_first_search_shortest_path.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
class Graph:
1818
def __init__(self, graph: Dict[str, str], source_vertex: str) -> None:
19-
"""Graph is implemented as dictionary of adjancency lists. Also,
19+
"""Graph is implemented as dictionary of adjacency lists. Also,
2020
Source vertex have to be defined upon initialization.
2121
"""
2222
self.graph = graph
@@ -37,11 +37,11 @@ def breath_first_search(self) -> None:
3737

3838
while queue:
3939
vertex = queue.pop(0)
40-
for adjancent_vertex in self.graph[vertex]:
41-
if adjancent_vertex not in visited:
42-
visited.add(adjancent_vertex)
43-
self.parent[adjancent_vertex] = vertex
44-
queue.append(adjancent_vertex)
40+
for adjacent_vertex in self.graph[vertex]:
41+
if adjacent_vertex not in visited:
42+
visited.add(adjacent_vertex)
43+
self.parent[adjacent_vertex] = vertex
44+
queue.append(adjacent_vertex)
4545

4646
def shortest_path(self, target_vertex: str) -> str:
4747
"""This shortest path function returns a string, describing the result:

0 commit comments

Comments
 (0)