If you can use a small memory, it sounds like a combo collection can work for you.
For example, what you are looking for looks like a linked list. You can always get a minimal element, but inserting or searching for an arbitrary node may take longer because you need to do an O (n) search
If you combine a linked list and a tree, you can get the best of both worlds. To find an item for get / insert / delete operations, you must use the tree to search for the item. The holder element node will have to have ways to move from the tree to the linked list for delete operations. Also, the linked list must be a doubly linked list.
So, I think that getting the smallest element will be O (1), any arbitrary search / delete will be O (logN) - I think that even the insert will be O (logN), because you can find where to put it in the tree, look to the previous item and go to your linked node list from there, and then add the "next".
Hmm, this starts to seem like a really useful data structure, maybe a little wasteful in memory, but I don't think any operation would be worse than O (logN) if you don't need to balance the tree.
source share