Java deque class
- or -
Post a project like this£30(approx. $38)
- Posted:
- Proposals: 12
- Remote
- #1894863
- Expired
✪Software Developer ✪Web Developer (Java,Python, Android, jee, JSP, JSF, Java Fx,Vue, Blue J, Nuxt) ✪ Processing ✪ Elastic Search ✪ Database
Saitama
202447420876132094168124416519784211902496131680112464131223406205827021347222058505
Description
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
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
Jack M.
0% (0)Projects Completed
-
Freelancers worked with
-
Projects awarded
0%
Last project
7 May 2024
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
Is it your home assignment?
590247
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies