We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b983690 commit 08e7789Copy full SHA for 08e7789
Python/_DATATYPES.py
@@ -2,12 +2,19 @@
2
3
#Definition for a binary tree node.
4
class TreeNode:
5
+ inOrder = []
6
def __init__(self, x):
7
self.val = x
8
self.left = None
9
self.right = None
10
def __str__(self):
11
return str(self.val)
12
+ def printInOrder(self, r):
13
+ if r.left: r.printInOrder(r.left)
14
+ self.inOrder += [r.val]
15
+ if r.right: r.printInOrder(r.right)
16
+ return self.inOrder
17
+
18
19
# Definition for singly-linked list.
20
class ListNode:
Python/__pycache__/_DATATYPES.cpython-37.pyc
231 Bytes
0 commit comments