title | date | draft | tags | categories | |||
---|---|---|---|---|---|---|---|
Algorithm4 Java Solution 1.3.38 |
2019-07-04 05:47:10 +0800 |
false |
|
|
Delete kth element. Implement a class that supports the following API.
First, develop an implementation that uses an array implementation, and then develop one that uses a linked-list implementation. Note : the algorithms and data structures that we introduce in Chapter 3 make it possible to develop an implementation that can guarantee that both insert() and delete() take time prortional to the logarithm of the number of items in the queue—see Exercise 3.5.27.
Array Solution:
LinkedListSolution: