Skip to content

Commit e8d3bff

Browse files
committed
construct binaryTree from preorder and inorder
1 parent 9f43d0b commit e8d3bff

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

construct_binaryTree_preorder_inorder.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# this is not an effective approach as it takes O(n^2) as it first takes O(n)
2+
# in pop first element from list and the searching for that element
3+
# and then slicing cause it O(n)
4+
15
class Node:
26
def __init__(self, data):
37
self.data = data

0 commit comments

Comments
 (0)