File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -195,6 +195,8 @@ You should know about `Binary Tree` and `Binary Search Tree`.
195195
196196A binary tree is a type of tree in which each node has ` at most two children ` (0, 1 or 2) which are referred as left child and right child.
197197
198+ ![ ] ( https://i.imgur.com/fkRP5Ju.png )
199+
198200#### Binary Search Tree (BST)
199201
200202In Binary Search Tree nodes are:
Original file line number Diff line number Diff line change 1+ /**
2+ * A binary tree is a type of tree in which each node has `at most two children` (0, 1 or 2) which are referred as left child and right child.
3+ */
4+
5+ class BinaryTreeNode {
6+ constructor ( data ) {
7+ this . data = data ;
8+ this . left = null ;
9+ this . right = null ;
10+
11+ this . parent = null ;
12+ this . next = null ;
13+ this . count = null ;
14+ }
15+ }
16+
17+ class TreeNode {
18+ constructor ( data ) {
19+ this . data = data ;
20+ this . children = [ ] ;
21+ }
22+ }
You can’t perform that action at this time.
0 commit comments