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
Define the various actions a process might be take upon receiving a signal? There are various actions a process might be take upon receiving a signal here are three different d

CGI is significant whenever you require to retain state information about a user, or run an application which communicates with the server. Things like guestbook's, Chat clients, d

representation of the adjacency matrix and adjacency list

Explain one dimensional arrays In one dimensional arrays array name is really a pointer to the first element in the array. Second element of the array can be accessed by using

is a technique of improving the priority of process waiting in Queue for CPU allocation? Ageing is a technique of enhancing the priority of process waiting in Queue for CPU all

In a LAN network every system is identified by? In a LAN network all systems are identified through IP Address.

What is the significance of the memory table 'SCREEN'? At runtime, attributes for every screen field are stored in the memory table called 'SCREEN'.  We need not declare this

Q. How to define a Filename in DOS? Each file is given a name so that it can be referred to later. This name is termed as Filename. The filename in DOS can be up to eight alpha

System Software 1. Explain MASM? Explain its features. 2. What is the significance of Lexical analysis and Syntax analysis? 3. Explain macros and macro processors? Explai

Q. What is Data link layer? Data link layer: data link layer is responsible for transmitting a group of bits between adjacent nodes. Group of bits is termed as frame. Network