-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathBSTree.java
56 lines (40 loc) · 1.19 KB
/
BSTree.java
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
52
53
54
// Class: Implementation of BST in A2
// Implement the following functions according to the specifications provided in Tree.java
public class BSTree extends Tree {
private BSTree left, right; // Children.
private BSTree parent; // Parent pointer.
public BSTree(){
super();
// This acts as a sentinel root node
// How to identify a sentinel node: A node with parent == null is SENTINEL NODE
// The actual tree starts from one of the child of the sentinel node!.
// CONVENTION: Assume right child of the sentinel node holds the actual root! and left child will always be null.
}
public BSTree(int address, int size, int key){
super(address, size, key);
}
public BSTree Insert(int address, int size, int key)
{
return null;
}
public boolean Delete(Dictionary e)
{
return false;
}
public BSTree Find(int key, boolean exact)
{
return null;
}
public BSTree getFirst()
{
return null;
}
public BSTree getNext()
{
return null;
}
public boolean sanity()
{
return false;
}
}