Java deque class

  • Posted:
  • Proposals: 12
  • Remote
  • #1894863
  • Expired
Aaron R.John N.Renato F.Md. Mahedi H.Acha B. + 7 others have already sent a proposal.
  • 9


Experience Level: Entry
You are required to write in either Java or Python 3 a class that implements the dequeue
ADT with methods for all of the primitive operations (The primitive operations are createdeq, isempty, left, right, addleft, addright, removeleft and removeright. other than createdeq, since a
deque can be created using code such as new Deque())

The class should have a (Java) constructor and should also have a (Java) toString that
generates a string of the form . The data in the class must be private.
The left, right, removeleft and removeright method should throw/raise an exception
when applied to an empty queue.

The class should be generic (i.e. declared as Dequeue). You should also write and submit code that tests the behaviour of all of the operations, generating output indicating what methods are being called and what results are
returned and displaying the contents of the queue whenever changes are made. A
fragment of the output might look like

Queue contents:
Adding 10 to left
Queue contents:
Calling right: 7 returned

You should include code to test the behaviour of the left, right, removeleft and
removeright operations when applied to an empty queue – this will require four separate
try-catch or try-except blocks.
The test code should not be interactive.
If you write the program in Java the test code must be written in a main method in a
separate class in a separate file; if you choose to use Python you may place the test code
in the same file, but it must be outside the class.

NO collections framework,
NO Deque interface
NO LinkedList

New Proposal

Create an account now and send a proposal now to get this job.

Sign up

Clarification Board Ask a Question

  • Yauheni V.

    Is it your home assignment?