Changed doctest examples

This commit is contained in:
miltonbhowmick 2023-08-08 14:16:27 +06:00
parent 85d33bea6c
commit 129176a4f3

View File

@ -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)]