Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8a73977

Browse files
committedDec 4, 2024
added 94 python
I don't know how I missed that the first time! It's no longer a blank file now.
1 parent d7e0206 commit 8a73977

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
 

‎0094-binary-tree-inorder-traversal.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
"""
2+
94. Binary Tree Inorder Traversal
3+
4+
Submitted: March 2, 2023
5+
6+
Runtime: 32 ms (beats 100.00%)
7+
Memory: 13.92 MB (beats 100.00%)
8+
"""
9+
10+
# Definition for a binary tree node.
11+
# class TreeNode:
12+
# def __init__(self, val=0, left=None, right=None):
13+
# self.val = val
14+
# self.left = left
15+
# self.right = right
16+
class Solution:
17+
def inorderTraversal(self, root: Optional[TreeNode]) -> List[int]:
18+
f=[]
19+
def z(n):
20+
if n is None:
21+
return
22+
z(n.left)
23+
f.append(n.val)
24+
z(n.right)
25+
z(root)
26+
return f

0 commit comments

Comments
 (0)
Please sign in to comment.