You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,8 @@
8
8
| :------------: | :----------: |
9
9
| Total Problems | 188 |
10
10
11
+
Current Daily Streak: 1 (started on 06/20/2019)
12
+
11
13
</center>
12
14
13
15
**Note: Some of the code here is old and was written when I was learning C++. It might be possible that code is not safe or making wrong assumptions. Please use with caution. Pull requests are always welcome.**
@@ -119,7 +121,7 @@ Include contains single header implementation of data structures and some algori
119
121
|Given a binary tree (unlike binary search tree), find the Lowest Common Ancestor (LCA).|[lowest-common-ancestor-binary-tree.cpp](tree_problems/lowest-common-ancestor-binary-tree.cpp)|
120
122
|Given a binary tree, print out all of its root-to-leaf paths one per line.| [printAllRootToLeafPath.cpp](tree_problems/printAllRootToLeafPath.cpp)
121
123
|Determine if a tree is sum tree. A SumTree is a Binary Tree where the value of a node is equal to sum of the nodes present in its left subtree and right subtree. An empty tree is SumTree and sum of an empty tree can be considered as 0. A leaf node is also considered as SumTree.|[sumTree.cpp](tree_problems/sumTree.cpp)|
122
-
|Convert a tree to sumTree, such that each node is sum of left and right subtree of the original tree.|[convert_to_sum_tree.cpp](tree_problems/convert_to_sum_tree.cpp)|
124
+
|Convert a tree to sumTree, such that each node is sum of left and right subtree of the original tree.|[convert_to_sum_tree.cpp](tree_problems/convert_to_sum_tree.cpp), [convert_to_sum_tree.py](tree_problems/convert_to_sum_tree.py)|
123
125
| Convert a sorted array to balanced binary search tree.|[sortedArrayToBST.cpp](tree_problems/sortedArrayToBST.cpp)|
124
126
| Given a binary tree, generate sum of each vertical column.|[verticalSum.cpp](tree_problems/verticalSum.cpp)|
125
127
| Given a binary tree and key, node with key exists in tree. Find all the ancestors of the node with key, ancestor here are the nodes which are in straight path from node to root.|[node_ancestors_in_root_path.cpp](tree_problems/node_ancestors_in_root_path.cpp)|
@@ -131,7 +133,7 @@ Include contains single header implementation of data structures and some algori
131
133
| Find kth smallest element in a binary search tree |[kth_smallest.cpp](tree_problems/kth_smallest.cpp)|
132
134
| Validate if a given binary tree is a binary search tree. |[validate_bst.cpp](tree_problems/validate_bst.cpp)|
133
135
| Given a Binary Search Tree and a target number, return true if there exist two elements in the BST such that their sum is equal to the given target.|[find_target_k.cpp](tree_problems/find_target_k.cpp)|
134
-
| Given a non-empty binary search tree and a target value, find the value in the BST that is closest to the target. Also, to note that the target value is a floating point. There will be only one unique value which is closest to the target. |[closest_bst_value.cpp](tree_problems/closest_bst_value.cpp)|
136
+
| Given a non-empty binary search tree and a target value, find the value in the BST that is closest to the target. Also, to note that the target value is a floating point. There will be only one unique value which is closest to the target. |[closest_bst_value.cpp](tree_problems/closest_bst_value.cpp), [closest_bst_value.py](tree_problems/closest_bst_value.py)|
135
137
| Given a binary tree, traversing preorder, construct a string output containing node values and parenthesis. The null node needs to be represented by empty parenthesis pair "()". And you need to omit all the empty parenthesis pairs that don't affect the one-to-one mapping relationship between the string and the original binary tree. Examples in code file|[string_from_tree.cpp](tree_problems/string_from_tree.cpp)|
0 commit comments