Queue, Computer Engineering

Assignment Help:

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.


Related Discussions:- Queue

Define busy waiting and spinlock, Define busy waiting and spinlock.  Wh...

Define busy waiting and spinlock.  When a process is in its critical section, any other process that tries to enter its critical section must loop continuously in the entry cod

What is refactoring, What is refactoring? Refactoring is explained as t...

What is refactoring? Refactoring is explained as the changes to the internal structure of software to improve its design without changing its external functionality. It is an e

Explain the parallel data storage - application of flip flop, Explain the P...

Explain the Parallel Data Storage - application of flip flops? In digital systems, data are usually stored in groups of bits that represent numbers, codes, or other information

Convert statement into conjunctive normal form , Consider the following sta...

Consider the following statements about the types of fruit people like. If people like apples, then they do not like oranges. If people do not like apples, then they like orang

Data hazards in computer architecture, Data hazards -  computer architec...

Data hazards -  computer architecture : A main effect of pipelining is to alter the relative timing of instructions by overlapping their execution. This introduces contro

What is a flip-flop, What is a flip-flop? Ans. Flip-flop is particu...

What is a flip-flop? Ans. Flip-flop is particular bit memory cell. This stores individual bit information in its true and compliment form. It is the basic block of any sequ

Writing down your own interrupt service routines, Q. Writing down your own ...

Q. Writing down your own Interrupt Service Routines? Here are a few rules which should be kept in mind while writing down your own Interrupt Service Routines: 1.  Use Int 21

Assembly Language program, How to get an output: Please enter a number betw...

How to get an output: Please enter a number between 0 and 6 (Enter to stop): 2 The Day of Week is Tuesday Please enter a number between 0 and 6 (Enter to stop): 9 Input Invalid Ple

How many precision resistors requires a weighted resistor, A weighted resis...

A weighted resistor digital to analog converter using N bits requires a total of ? Ans. Digital to analog converter, a weighted resistor using N bits needs a total of N precisi

Predicates in first-order logic sentences , Predicates in first-order logic...

Predicates in first-order logic sentences - artificial intelligence There are predicates first and foremost in first-order logic sentences. These are indications that some thin

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