Skip to content

Commit 6aefea3

Browse files
committed
update
1 parent 89042e4 commit 6aefea3

3 files changed

Lines changed: 14 additions & 9 deletions

File tree

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Time: O((25n) ^ n)
2-
# Space: O((25n) ^ n)
1+
# Time: O((25n)^n)
2+
# Space: O((25n)^n)
33
#
44
# Given two words (start and end), and a dictionary, find all shortest transformation sequence(s) from start to end, such that:
55
#
@@ -62,4 +62,4 @@ def backtrack(self, result, trace, path, word):
6262
self.backtrack(result, trace, [word] + path, prev)
6363

6464
if __name__ == "__main__":
65-
print Solution().findLadders("hit", "cog", set(["hot","dot","dog","lot","log"]))
65+
print Solution().findLadders("hit", "cog", set(["hot","dot","dog","lot","log"]))
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Time: O((25n) ^ n)
2-
# Space: O((25n) ^ n)
1+
# Time: O((25n)^n)
2+
# Space: O((25n)^n)
33
#
44
# Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that:
55
#
@@ -47,4 +47,4 @@ def ladderLength(self, start, end, dict):
4747
return 0
4848

4949
if __name__ == "__main__":
50-
print Solution().ladderLength("hit", "cog", set(["hot","dot","dog","lot","log"]))
50+
print Solution().ladderLength("hit", "cog", set(["hot","dot","dog","lot","log"]))

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,8 @@ Problem | Solution | Time | Space | Difficul
468468
[Binary Tree Zigzag Level Order Traversal]| [binary-tree-zigzag-level-order-traversal.py] | _O(n)_| _O(n)_| Medium |
469469
[Clone Graph]| [clone-graph.py] | _O(n)_ | _O(n)_ | Medium |
470470
[Populating Next Right Pointers in Each Node II]|[populating-next-right-pointers-in-each-node-ii.py]| _O(n)_ | _O(1)_ | Hard |
471-
[Surrounded Regions]|[surrounded-regions.py]| _O(m * n)_ | _O(m + n)_ | Medium |
471+
[Surrounded Regions]|[surrounded-regions.py]| _O(m * n)_ | _O(m + n)_ | Medium |
472+
[Word Ladder] |[word-ladder.py] | _O((25n)^n)_ | _O((25n)^n)_ | Medium |
472473

473474
[Binary Tree Level Order Traversal]:https://oj.leetcode.com/problems/binary-tree-level-order-traversal/
474475
[binary-tree-level-order-traversal.py]:https://github.com/kamyu104/LeetCode/blob/master/Python/binary-tree-level-order-traversal.py
@@ -482,7 +483,8 @@ Problem | Solution | Time | Space | Difficul
482483
[populating-next-right-pointers-in-each-node-ii.py]:https://github.com/kamyu104/LeetCode/blob/master/Python/populating-next-right-pointers-in-each-node-ii.py
483484
[Surrounded Regions]:https://oj.leetcode.com/problems/surrounded-regions/
484485
[surrounded-regions.py]:https://github.com/kamyu104/LeetCode/blob/master/Python/surrounded-regions.py
485-
486+
[Word Ladder]:https://oj.leetcode.com/problems/word-ladder/
487+
[word-ladder.py]:https://github.com/kamyu104/LeetCode/blob/master/Python/word-ladder.py
486488

487489
---
488490

@@ -592,7 +594,10 @@ Problem | Solution | Time | Space | Difficul
592594
##Backtracking
593595
Problem | Solution | Time | Space | Difficulty | Notes
594596
--------------- | --------------- | --------------- | --------------- | -------------- | -----
595-
|||||
597+
[Word Ladder II] |[word-ladder-ii.py] | _O((25n)^n)_ | _O((25n)^n)_ | Hard |
598+
599+
[Word Ladder II]:https://oj.leetcode.com/problems/word-ladder-ii/
600+
[word-ladder-ii.py]:https://github.com/kamyu104/LeetCode/blob/master/Python/word-ladder-ii.py
596601

597602
---
598603

0 commit comments

Comments
 (0)