If you have a dictionary:
d = {1: True, 2: False, 3: False, 4: True, 5: False, 6: True, 7: False, 8: False}
and you want all keys greater than 3 to be deleted so the dictionary becomes:
{1: True, 2: False, 3: False}
can you do this in constant time if the keys are sorted?