mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-05-22 08:21:12 -04:00
Update and rename bst_all_subnodes.py to bst_all_subnodes.py
This commit is contained in:
parent
cd5ac00126
commit
eedb6b6863
1 changed files with 1 additions and 3 deletions
|
@ -14,7 +14,6 @@ def all_possible_bst(start, end, memo):
|
|||
|
||||
result = []
|
||||
if start > end:
|
||||
result.append(None)
|
||||
return result
|
||||
|
||||
if (start, end) in memo:
|
||||
|
@ -26,8 +25,7 @@ def all_possible_bst(start, end, memo):
|
|||
|
||||
for l in left:
|
||||
for r in right:
|
||||
root = Node(i, l, r)
|
||||
result.append(root)
|
||||
result.append(Node(i, l, r))
|
||||
|
||||
memo[(start, end)] = result
|
||||
return result
|
Loading…
Add table
Add a link
Reference in a new issue