Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1a02986

Browse files
committed
Fixed if is not None syntax error.
1 parent cb713c1 commit 1a02986

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

‎preorder_iterative_bst.py‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ def preOrderTraversal(root):
44
while len(stack) > 0:
55
current = stack.pop()
66
print(current.value)
7-
7+
88
right = current.right
9-
stack.insert(0, right) if right is not None
10-
9+
if right is not None:
10+
stack.insert(0, right)
11+
1112
left = current.left
12-
stack.insert(0, left) if left is not None
13+
if left is not None:
14+
stack.insert(0, left)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /