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
Discuss the concept of segmentation? Segmentation is method for the non contiguous storage allocation. This is different from paging as this supports user's view of his program

Question: a) Write a small program using floating-point operations in Reverse Polish Notation to evaluate the following: Volume of Sphere = (4/3)πr 3 Consider that the u

Optimum solution based on constraint problems: Whether depending on what solver you are using so there constraints are often expressed as relationships between variables as e.

Explain the various interface circuits.  An I/O interface having of circuitry required to connect an I/O device to computer bus. One side having of a data path with its associa

Example of Unification: Let now here, assume instead that we had these two sentences as:  knows(john,X) → hates(john, X)  knows(jack, mary)  Thus here the predicate n

What are the Steps include constructing a Functional Model Recognize input and output values Build data flow diagrams which shows functional dependencies Explain

Performance and Issues in Pipelining Efficiency:  The efficiency of a pipeline can be calculated as the ratio of busy time span to the entire time span including the idle time


How many lines of address bus must be used to access 2048 bytes of memory when available RAM chips 128 × 8.  How many lines of these will be common to each chip? Ans. AS chips

what are the questionnaries and observation of work site for banking system?