Skip to content

Commit 979cbc0

Browse files
committed
104. Maximum Depth of Binary Tree (변수명 수정)
1 parent b5c8317 commit 979cbc0

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

maximum-depth-of-binary-tree/okyungjin.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ def maxDepth(self, root: Optional[TreeNode]) -> int:
1313
return 0
1414

1515
max_depth = 1
16-
queue = [(root, 1)]
16+
stack = [(root, 1)]
1717

18-
while queue:
19-
node, cur_depth = queue.pop()
18+
while stack:
19+
node, cur_depth = stack.pop()
2020
max_depth = max(cur_depth, max_depth)
2121

2222
if node.left:

0 commit comments

Comments
 (0)