MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / construct_path

Function construct_path

graphs/bidirectional_search.py:41–46  ·  view source on GitHub ↗
(current: int | None, parents: dict[int, int | None])

Source from the content-addressed store, hash-verified

39
40
41def construct_path(current: int | None, parents: dict[int, int | None]) -> list[int]:
42 path: list[int] = []
43 while current is not None:
44 path.append(current)
45 current = parents[current]
46 return path
47
48
49def bidirectional_search(

Callers 1

bidirectional_searchFunction · 0.85

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected