Skip to content

Latest commit

 

History

History
36 lines (21 loc) · 867 Bytes

Ex_1_3_38.md

File metadata and controls

36 lines (21 loc) · 867 Bytes
title date draft tags categories
Algorithm4 Java Solution 1.3.38
2019-07-04 05:47:10 +0800
false
JAVA
TECH
archives

1.3.38

Problem:

Delete kth element. Implement a class that supports the following API.

2019-07-27-001

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.

Solution:

Array Solution:

Ex_1_3_38.java

LinkedListSolution:

Ex_1_3_38_2.java

Reference: