Queue, Computer Engineering

A Queue is a FIFO ( rst in, rst out) data structure. Given the following queue interface:

public interface Queue {

int size(); // current queue size

boolean isEmpty(); // true if queue is empty

void enqueue(Object element); // add element at end of queue

Object dequeue(); // return and remove first element.

Object first(); // return (without removing) first element

Object last(); // return (without removing) last element

Iterator iterator(); // element iterator
}

The iterator iterates over all elements of the queue. Operations not allowed on an empty queue shall generate an unchecked exception.

Do the following:

 Create a linked implementation (LinkedQueue.java) of the interface Queue.

Write a test program QueueMain.java, showing how all methods work.


Create Javadoc comments in the code and generate good-looking and extensive

HTML documentation for the interface and the class. All public class members shall be documented.

Note:
 The implementation shall be linked, i.e. a sequence of linked nodes where each node represents an element.


You may not use any of the prede ned classes in the Java library.

 In the report, the HTML pages generated by the classes Queue and LinkedQueue shall be attached. Attach no other HTML pages!
 Check the extra slides before you start.

Posted Date: 3/14/2013 6:14:21 AM | Location : United States







Related Discussions:- Queue, Assignment Help, Ask Question on Queue, Get Answer, Expert's Help, Queue Discussions

Write discussion on Queue
Your posts are moderated
Related Questions
Why a function can n ot call a task As functions doesn't consume time,it can do any operation which doesn't consume time. Mostly tasks are written that consumes time. So a ta

Yet another type of input is HIDDEN input. A HIDDEN input is a value/name pair which is returned to you but doesn

First-Order Logic : There's Reasoning, and then There's Reasoning As humans, we have always prided ourselves on our capability to think things by: to reason things out and c

Addresses are basically for virtually everything we do on Internet. The IP in TCP/IP is a mechanism for providing addresses for computers on Internet. Internet addresses have two f


We perform load testing once we are completed with interface (GUI) testing. Modern system architectures are large and difficult. Whereas one user testing primarily on functionality

What are stacks? A stack  is an abstract data type in which items are additional to and removed only from one end known as TOP. For example, consider the pile of papers on you

Using               ARQ, a sending modem must wait for a return ACK for each sent block before sending the next block. (A)  discrete                                      (B)

By 2 pointers you can find it. One of them goes 2 nodes each time. The second one goes at 1 node each time. If there is a cycle, the one that goes 2 nodes every time will eventuall

Q Convert the following DECIMAL numbers into HEXADECIMAL, double check by converting the result HEXADECIMAL to DECIMAL. a)    24 b)   547.56