For an application that uses a symbol table, the two implementations are interchangeable as far as correctness goes provided the Key type implements Comparable.
But the methods have different performace times for the two implementations.
For each method which class has the faster method?
How does each method do its task?
Method | SequentialSearchST | BinarySearchST |
---|---|---|
put(k, v) | ||
v = get(k) | ||
delete(k) |