Create and test a class for a queue of objects

Assignment Help Data Structure & Algorithms
Reference no: EM131694924

Assignment

Your assignment is to create and test a class for a queue of objects. You may use any object class of your choice as the data for the queue. The instances of the class should have at least one field that distinguishes each instance from other instances of the class (key property, also called a key field).

You should complete the software to implement and test your queue and submit the software along with a project report.

Your queue class should maintain a head pointer to the first element in the queue, a tail pointer to the last element in the queue, and the size of the queue as queue properties.

We will add elements to the tail of the queue and remove elements from the head of the queue. The head pointer points to the spot from which elements are deleted from the queue, and the tail pointer points to the end of the queue where elements are added to the queue.

Note that elements move though the queue in the opposite direction of the pointers from one element to the next. Head points to the first element in the queue. Head.next points to the element that will become the head when the head is removed (de-queue method) - the pointers point back in the queue.

You should have methods to:

• instantiate a null queue
• enqueue - add an element to the queue
• dequeue - remove an element from the queue
• size - return the size of the queue
• a boolean isEmpty method

You will need to create a class of nodes for the data in the queue, which we call a queueElement.

Each queueElement should have data and a pointer to the next queueElement.

We need:

• A null constructor (default)
• An initializing constructor (instantiates a queueElement from a data element)

and methods to :

• set the data in a queue element
• return the data in a queue element
• set the pointer to the next element
• return the pointer to the next element

This assignment requires four classes - Queue, QueueElement, the data object class, and a class for your test project. Each class should be a separate file in your NetBeans project, all in the same source directory.

Reference no: EM131694924

Questions Cloud

How does its differ from programmed instruction : How does ITS differ from programmed instruction? What are possible roadblocks for each type?
Computer problems caused by a virus : Have you or someone you know experienced computer problems caused by a virus? How did it get into the system and how did it first present itself?
Hospitality service-physical products presentation : Create a 10- to 12-slide presentation with speaker notes on fundamental differences between marketing hospitality services and marketing physical products
List the characteristics that are unique to enzymes : List the characteristics that are unique to enzymes. List the main factors that affect enzyme action.List the 6 classes of enzyme functions
Create and test a class for a queue of objects : Your assignment is to create and test a class for a queue of objects. You may use any object class of your choice as the data for the queue.
Discussion topic on post-implementation audits : This week, only the first Discussion topic on post-implementation audits is graded. Draw from your personal and professional experiences to answer the questions
Describe the rise of professional sports in america : Major cities grew rapidly in the 19th century. Identify and discuss the problems these cities dealt with as a result of rapid growth
Research the two diseases hiv and hcv : For your initial post, research the two diseases HIV and HCV. There are many opinions on the need and/or importance of vaccines in preventing spread of disease
Why did the investigator help the prosecutor make the case : did the investigator help the prosecutor make the case? What do you think are the most important skills that an investigator can have during a trial?

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

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