Question: I need help with this java code: My Code: import java.util.*; public class ListDeque implements IDeque { // this time store the deque in a

I need help with this java code:

My Code:

import java.util.*; public class ListDeque implements IDeque { // this time store the deque in a list // myQ.get(0) is the front of the deque private List myQ;

public ListDeque(){}
public void enqueue(Integer x){}
public Integer dequeue() {} 
public void inject(Integer x) {}
public Integer removeLast() {}
public int length() {}
public void clear() {}

// complete the class }

Finish implementing the ListDeque class. a. Add a constructor to the class that creates an "empty" deque. The constructor should not have any parameters. b. You will need to add any necessary contracts and Javadoc comments to the constructor. c. Add the methods needed to meet the interface specification d. Do not add any additional methods e. Do not add any additional private data fields f. Add your correspondences and invariants to the class.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!