mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-25 10:28:39 +00:00
Changed doctest examples
This commit is contained in:
parent
85d33bea6c
commit
129176a4f3
@ -83,12 +83,7 @@ class UniformCostSearch:
|
|||||||
) -> list[list[int]]:
|
) -> list[list[int]]:
|
||||||
"""
|
"""
|
||||||
Return 2D list where optimal path is stored.
|
Return 2D list where optimal path is stored.
|
||||||
>>> get_shortest_path(
|
>>> get_shortest_path([0, 2],[1, 2],[['inf','inf',1],['inf,2,2]],[(1, 1),(1, 0),(1, -1),(0, -1),(-1, -1),(-1, 0),(-1, 1),(0, 1)])
|
||||||
[0, 2],[2, 2],
|
|
||||||
[['inf','inf',1],
|
|
||||||
['inf,2,2],['inf',0,3]],
|
|
||||||
[(1, 1),(1, 0),(1, -1),(0, -1),(-1, -1),(-1, 0),(-1, 1),(0, 1)]
|
|
||||||
)
|
|
||||||
|
|
||||||
[[0,2],[1,2],[2,2]]
|
[[0,2],[1,2],[2,2]]
|
||||||
"""
|
"""
|
||||||
@ -123,15 +118,7 @@ class UniformCostSearch:
|
|||||||
) -> list[list[int]]:
|
) -> list[list[int]]:
|
||||||
"""
|
"""
|
||||||
Return 2D list where optimal path is stored.
|
Return 2D list where optimal path is stored.
|
||||||
>>> ucs(
|
>>> ucs([0, 2],[[1, 2]],[[0,0,0],[0,0,0]],[[None, None, None],[None, None, None]],[(1, 1),(1, 0),(1, -1),(0, -1),(-1, -1),(-1, 0),(-1, 1),(0, 1)],[1000000, 100000])
|
||||||
[0, 2],
|
|
||||||
[[1,2],[2, 2]],
|
|
||||||
[[0,0,0],[0,0,0],[0,0,0]],
|
|
||||||
[[None, None, None], [None, None, None],[None, None, None]],
|
|
||||||
[(1, 1),(1, 0),(1, -1),(0, -1),(-1, -1),(-1, 0),(-1, 1),(0, 1)],
|
|
||||||
[1000000, 100000]
|
|
||||||
)
|
|
||||||
|
|
||||||
[[0,2],[1,2],[2,2]]
|
[[0,2],[1,2],[2,2]]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -186,7 +173,7 @@ class UniformCostSearch:
|
|||||||
) -> list[list[int]]:
|
) -> list[list[int]]:
|
||||||
"""
|
"""
|
||||||
Return 2D list where optimal path is stored.
|
Return 2D list where optimal path is stored.
|
||||||
>>> your_algorithm([0, 2],[2, 2], [[0,0,0],[0,0,0],[0,0,0]])
|
>>> your_algorithm([0, 2],[1, 2], [[0,0,0],[0,0,0]])
|
||||||
[[0,2],[1,2],[2,2]]
|
[[0,2],[1,2],[2,2]]
|
||||||
"""
|
"""
|
||||||
prev = [[None for _ in range(self.m)] for _ in range(self.n)]
|
prev = [[None for _ in range(self.m)] for _ in range(self.n)]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user