For an ordered symbol table st, the floor and ceiling methods have the following specifications:
Key floor(Key k)
If the key k is in st, then st.floor(k) should return k
If the key k is NOT in st, st.floor(k) should return
- null if k is smaller than the minimum key, otherwise
- the largest key kf in st that is smaller than k
Key ceiling(Key k)
If the key k is in st, then st.ceiling(k) should return k
If the key k is NOT in st, st.ceiling(k) should return
- null if k is larger than the maximum key, otherwise
- the smallest key kc in st that is larger than k