I am trying to create a queue of events and I want to be able to insert and delete from the middle of the queue in constant time, something like this:
3446 --- 9493 --- 15969 --- 48381
where the number could be millis from now, or whatnot.
How could I insert an event between the 9493 and 15969 event?
I could use binary search to find the events in the queue with the desired times, but is there an easier way?