Are there any ordered container that allow O(n) in-ordered deletion and traversal? I'm trying to do the following:
Hello -> 1,2,3,4,5,6
Hello1 -> 24,15,13,10,8,7
I need to be able to insert and delete continuously from Hello or Hello1 as quickly as possible. I was thinking of using a priority queue, but each time I want to delete I spend O(logn) adjusting, so n deletions will cost me O(nlogn) time to keep the internal structure ordered. Are there any data structures that can accomplish this task in O(n) time?