-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBinarySearchTreeADT.java
52 lines (46 loc) · 1.41 KB
/
BinarySearchTreeADT.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
public interface BinarySearchTreeADT<T> extends BinaryTreeADT<T>
{
/**
* Adds the specified element to the proper location in this tree.
*
* @param element the element to be added to this tree
*/
public void addElement(T element);
/**
* Removes and returns the specified element from this tree.
*
* @param targetElement the element to be removed from the tree
* @return the element to be removed from the tree
*/
public T removeElement(T targetElement);
/**
* Removes all occurences of the specified element from this tree.
*
* @param targetElement the element to be removed from the tree
*/
public void removeAllOccurrences(T targetElement);
/**
* Removes and returns the smallest element from this tree.
*
* @return the smallest element from the tree.
*/
public T removeMin();
/**
* Removes and returns the largest element from this tree.
*
* @return the largest element from the tree
*/
public T removeMax();
/**
* Returns the smallest element in this tree without removing it.
*
* @return the smallest element in the tree
*/
public T findMin();
/**
* Returns the largest element in this tree without removing it.
*
* @return the largest element in the tree
*/
public T findMax();
}