Index
This section describes the required headers for a BST.

We need to have pre-specified headers so that other coders know how to use the hash table.

Only the headers are required. "How" the implementation (logic) is coded is coder's choice.

Note: All of the required headers must be public.

Class Headers


JavaScript
class BST

class BSTNode
Java
public class BST<E, K> implements BstADT<E, K>
Where:
  • E - generic parameter for element data type
  • K - generic parameter for the key data type

By "element" we mean the elements stored in the hash table (Customers, Employees, etc). If pre-testing, value could also be prim-like objects such as integers, strings, etc.


Constructor Method Headers


The constructors are simple static factory methods

JavaScript
//Constructor with two params (returns BST using params)
static fromSortFctSearchFct(sortFct, searchFct)
Java
//Constructor with two params (returns BST using params)
public static <E, K> BST<E, K> fromSortFctSearchFct(Comparator<E> aSortFct, BiFunction<K, E, Integer> aSearchFct)


Instance Method Headers (ADT)