Implement queues - linked list, JAVA Programming

Assignment Help:

Implement Queues / Linked List

Project Description:

In this project, two kinds of queue are implemented: LinkedQueue implements FIFOQueueInterface { .... } and LLQueueItr implements Iterable, FIFOQueueInterface { ... }. Note that FIFOQueueInterface should be described before the two queues are implemented.

Public interface FIFOQueueInterface

{

boolean isEmpty();

void enqueue(T item);

T dequeue();

}

Two queues should implement those three methods, isEmpty(), dequeue() and enqueue(). Both have inner class Node which has data and next with the constructor.

LinkedQueue.java will be defined as follows. The blanks should be filled.

Now, consider LLQueueItr.java. It implements both FIFOQueue and Iterable. The interface FIFOQueue is the same as described above, and the interface Iterable is givenby jdk (java.lang.Iterable). It turns out that LLQueueItr should implements all methods from the both interfaces. The method isEmpty(), enqueue() and dequeue() are defined same as in the class LinkedQueue. In addition to that, according to the API of Iterable, the method, iterator() should be implemented. The API says the method iterator() return an object of Iterator. Iterator is an interface in jdk (java.util.Iterator), and it has three methods, hasNext(), next() and remove(), which should also be implemented.

As a driver program invokes the method, iterator(), which returns an object in Iterator, it will use the returned object to invoke the methods of Iterator class. For example, hasNext() method is used to check if the next node of queue is available. If so, the method next() will return the content of that node and move to the next node. To make this possible, those methods should be implemented in the LLQueueItr class.

Skills required: Java


Related Discussions:- Implement queues - linked list

Answer, a program to find the area under curve y=f(x) between x=a and x=b,i...

a program to find the area under curve y=f(x) between x=a and x=b,integrate y=f(x) between the limits of a and b

How can you pass parameters in rmi?, RMI parameters : Primitive types ...

RMI parameters : Primitive types are given by value. 2. References to remote objects are given as remote references that allow the client process to call methods on the rem

Need facebook developer, Project Description: i am seeking an experience...

Project Description: i am seeking an experienced Facebook page builder,fanpage builder, Header module Navigation menu module HTML module Widget module Image modul

Application rewrite, Application Rewrite Project Description: There i...

Application Rewrite Project Description: There is an app that I want to be rewritten in order to support multiple profiles. The App is an OTP generator. It is required to

Program for sorting algorithm - java program, Introduction: In this pr...

Introduction: In this project, you will explore a few sorting algorithms. You will also test their efficiency by both timing how long a given sorting operation takes and count

J2ee java website rebuild, J2EE Java Website rebuild Project Description...

J2EE Java Website rebuild Project Description: We are seeking an experienced developer to re-build a Java/J2EE based Website. We are in requirement to reconstruct our website

Explain about the static classes, Explain about the Static classes A  ...

Explain about the Static classes A  class  can  have  static  variables    and    methods.    Static    methods    and    variables    are  associated  with  class  itself  an

Write javascript code to convert the number, Write JavaScript code to conve...

Write JavaScript code to convert the number 236.2363611111556 into currency format and JavaScript statement to show output? Var input_amt = 236.2363611111556 ; mid_data = input

I need the app to be developed for android, I have a very simple app that I...

I have a very simple app that I have developed and is in the AppStore. I need the app to be developed for Android as it is presently in Objective C only. All plist html/ lists s

I need java expert with tomcat tuning experience, I need Java expert with t...

I need Java expert with tomcat tuning experience Project Description: Require a Java expert to fix memory issues with tomcat. Skills required: Java, Apache

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd