From 728c0df3556ed62a2756898655b5d2144cc9d637 Mon Sep 17 00:00:00 2001 From: Marcos Cannabrava <54267712+marcoscannabrava@users.noreply.github.com> Date: Tue, 7 Jul 2020 00:00:07 -0300 Subject: [PATCH] Fix typo: Adjancent -> Adjacent (#2184) --- graphs/breadth_first_search_shortest_path.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/graphs/breadth_first_search_shortest_path.py b/graphs/breadth_first_search_shortest_path.py index e556d7966..c25a5bb4f 100644 --- a/graphs/breadth_first_search_shortest_path.py +++ b/graphs/breadth_first_search_shortest_path.py @@ -16,7 +16,7 @@ graph = { class Graph: def __init__(self, graph: Dict[str, str], source_vertex: str) -> None: - """Graph is implemented as dictionary of adjancency lists. Also, + """Graph is implemented as dictionary of adjacency lists. Also, Source vertex have to be defined upon initialization. """ self.graph = graph @@ -37,11 +37,11 @@ class Graph: while queue: vertex = queue.pop(0) - for adjancent_vertex in self.graph[vertex]: - if adjancent_vertex not in visited: - visited.add(adjancent_vertex) - self.parent[adjancent_vertex] = vertex - queue.append(adjancent_vertex) + for adjacent_vertex in self.graph[vertex]: + if adjacent_vertex not in visited: + visited.add(adjacent_vertex) + self.parent[adjacent_vertex] = vertex + queue.append(adjacent_vertex) def shortest_path(self, target_vertex: str) -> str: """This shortest path function returns a string, describing the result: