-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBinarySearchTree.java
More file actions
51 lines (49 loc) · 1.48 KB
/
BinarySearchTree.java
File metadata and controls
51 lines (49 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package DataStructures;
/**
* <pre>
* A Binary Search Tree (BST) is a binary tree that satisfies the Binary Search Tree property / BST invariant
* which means that for every node, the value of the left subtree nodes are less than the value of the node
* and the value of the right subtree nodes are greater than the value of the node
*
* Examples:
* 5
* _____|_____
* / \
* 3 7
* / \ / \
* 2 4 6 8
*
*
* 1
* \
* 20
* /
* 19
* /
* 2
* \
* 3
* \
* 18
* /
* 17
*
* BSTs are used in many applications, for example in searching, sorting, and storing data.
* - Implementation of some map and set ADTs
* - Red Black Trees
* - AVL Trees
* - Splay Trees
* - Binary Heaps
* - Syntax trees (used by compilers and calculators)
* - Treap tree - A probabilistic DS called Randomized BST --> Balanced BST just like Red-Black and AVL Trees
* - In Priority Queues but not Heaps
*
*
* </pre>
* @author Srinivas Vadige, srinivas.vadige@gmail.com
* @since 11 Jan 2025
*/
public class BinarySearchTree {
public static void main(String[] args) {
}
}