previous | start | next

The floor and ceiling Methods

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

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



previous | start | next