Find the appropriate data structure
Lets see if you have solutions to the standard problems. Lets define the suitable data structures.
Guess the data structues between the 2 data structures provided (in italics).
Operations are Insert, DeleteMax, and DeleteMin.
balanced tree or sorted doubly-linked list
The balanced tree is better since all operations take O(log n) time. The sorted doubly-linked list is O(1) for DeleteMax and DeleteMin, but Insert is O(n); thus, the average time per operation is O(n).
[Read More]