in reply to hashing intervals

Since the order matters in such a case, a hash might not be the best data structure, I would also go for a sorted array and a binary search.