-
Notifications
You must be signed in to change notification settings - Fork 0
/
BPTreeADT.java
53 lines (46 loc) · 1.44 KB
/
BPTreeADT.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
package application;
import java.util.List;
/**
* A generic B+ Tree interface (DO NOT edit this file)
*
* @author sapan ([email protected])
*/
public interface BPTreeADT<K, V> {
/**
* Inserts the key and value in the appropriate nodes in the tree
*
* Note: key-value pairs with duplicate keys can be inserted into the tree.
*
* @param key
* @param value
*/
public void insert(K key, V value);
/**
* Gets the values that satisfy the given range
* search arguments.
*
* Value of comparator can be one of these:
* "<=", "==", ">="
*
* Example:
* If given key = 2.5 and comparator = ">=":
* return all the values with the corresponding
* keys >= 2.5
*
* If key is null or not found, return empty list.
* If comparator is null, empty, or not according
* to required form, return empty list.
*
* @param key to be searched
* @param comparator is a string
* @return list of values that are the result of the
* range search; if nothing found, return empty list
*/
public List<V> rangeSearch(K key, String comparator);
/**
* Returns a string representation for the tree
* This method is provided to students in the implementation.
* @return a string representation
*/
public String toString();
}