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
Q. Explain functions of direct memory access? Though CPU intervention in DMA is minimised however it should use path between interfaces that is system bus. So DMA involves an e

differentiate between concentration cells and electrolytic cells with suitable examples?

Paged virtual memory: Mostly all implementations of virtual memory divide the virtual address space of an application program into pages; a page is a block that contains conti

Probelm : a) What is the purpose of "Jumps" in the 8051 Microcontroller? Describe three types of "Jumps". b) What is the purpose of a "call"? c) Differentiate between ROM

Hyper cube or multidimensional cube forms the core of OLAP system. This having of measures which are arranged according to dimensions. Hyper cube Meta data is formed by star or sno

Let's answer our second question first. All computers have a Unit which performs arithmetic and logical functions. This Unit is called as Arithmetic and Logic Unit (ALU). However h

Advantages on electronic payment system It gives good security schemes.  Four necessary security requirements for safe e-payments are Authentication, Encryption, Integrity,

The difference among the next and continue verb is that in the continue verb it is used for a situation where there is no EOF condition that is the records are to be accessed again

What is meant by stacked list? A stacked list is nothing but secondary list and is showed on a full-size screen unless you have specified its coordinates using the window comm

Write a decision table that specifies the rules for the game of checkers