Generalized queue. Implement a class that supports the following API, which generalizes both a queue and a stack by supporting removal of the i th least recently inserted item (see EXERCISE 4.3.40):
Use a BST that associates the kth item inserted into the data structure with the key k and maintains in each node the total number of nodes in the subtree rooted at that node. To find the i th least recently inserted item, search for the i th smallest key in the BST.
EXERCISE 4.3.40
Generalized queue. Implement a class that supports the following API, which generalizes both a queue and a stack by supporting removal of the ith most recently inserted item:
First, develop an implementation that uses a resizing array, and then develop one that uses a linked list.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.