Class definition for queue

Assignment Help Basic Computer Science
Reference no: EM131158102

A First-In First-Out queue consists of an array of maximum of 20 integers, a head pointer and a tail pointer which are integers showing the indexes of the first and last data positions in the array.

a) Write the class definition for this queue, in pseudocode or C++, which has the array, head and tail pointers as public data structures, and enque(int) and int dequeue() as two methods. The contsructor initializes head and tail pointers to NULL.

b) Create a q1 object of this class and insert 12 and 7 data items into q1 consecutively and show the queue after each operation.

Reference no: EM131158102

Questions Cloud

Initial array element in c code : How can you refer to or call the initial array element in C code?
Suppose a binary tree contained the nodes : Suppose a binary tree contained the nodes W, X, Y, and Z. If W and X were children of Y, and Z had no children, which node would be the root?
Compare the five types of data and explain how they differ : Find and state the definition of levels of measurement that distinguishes the five types of data used in statistical analysis. In your own words, compare the five types of data and explain how they differ.
Relation suppliers containing the attributes supplierid : Given the relation Parts containing the attributes PartName, PartNumber, and SupplierID as well as the relation Suppliers containing the attributes SupplierID, Address, FaxNumber, write a sequence of SELECT, PROJECT, and JOIN operations to obtain ..
Class definition for queue : Write the class definition for this queue, in pseudocode or C++, which has the array, head and tail pointers as public data structures, and enque(int) and int dequeue() as two methods. The contsructor initializes head and tail pointers to NULL.
Does the information media have social responsibility : Answer the following questions: Does the information media have social responsibility? If yes, in what ways? If not, why not? What is the role of the information and news media in the shaping of political opinions
How many simultaneous message could be set along this system : In actual system only 672 message channels are used. The additional pulses are used for other functions such as synchronization
Describe the ways in which homeless is a social problem : Some of the policies suggested in the video involve government policies and funds to address homelessness. Suggest at least one other way that policies and/or programs to address homelessness can be funded. How do you define what is appropriate u..
Operation at a certain track begins : Simulate the behavior of the elevator algorithm for these requests. Which of the following correctly describes the time (in milliseconds) at which the I/O operation at a certain track begins?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Whether you are restricted to only the designated ports

Per industry standards, there are over 65535 ports used by computers, however the first 1023 are considered well-known ports. Assess the significance of the well-known ports, and determine whether it is possible to use any port or whether you are ..

  Pmt function to calculate the payments for students

In cell H13, insert a PMT function to calculate the payments for students who want to pay for their trips in three installments. Use the interest rate and months in the input area above the data. Use appropriate relative, mixed, and/or absolute ce..

  Determine the size and contents

Determine the size and contents of: e=1:-1:5;

  Article related to cloud-enabling technology

Find 1 article related to Cloud-Enabling Technology and to turn in the following: (1) TheURL of the article, (2) A brief summary of the article, and (3) a brief statement of your thoughts on the article. These items should be no more than 1 page in l..

  Assignment on the role and value of social media marketing

Assignment on the Role and Value of Social Media Marketing

  Take two numbers as input, a width and height

Using for loops: Take two numbers as input, a width and height. Create a square where there are WIDTH numbers on each line, and HEIGHT rows. Remember, print(someString, end="") prints without a line break.

  What three groups of people at the law firm

The law firm of Dewey, Cheatham, & Howe is considering the implementation of a new information system. To that end, they have hired your firm to perform the Systems Analysis process. They understand that a successful system must be aligned with th..

  How to boost over company-s former speed champ

Explain the definition (or definitions) of performance which you think the company utilzed. Do you believe the news release is misleading?

  Design a flowchart or pseudo code for the following

A program that prompts the user for a three-digit area code. Then the program continuously accepts phone call data until eof is reached, and displays data for any phone call to or from the specified area code.

  Perceptions of product create its personality

Perceptions of product create its personality. Bottom, round the back. And even there they are ugly. Is that essential? Could they not, in some small degree, give pleasure?

  Determine the largest mass of block b

If block A has a mass of 1.5 kg, determine the largest mass of block B without causing motion of the system. The coefficient of static friction between the blocks and inclined planes is .

  Secure the network and protect access to the web

Describe the significant reasons to secure the Network and protect access to the Web - What are some of these advantages, and from an Information Security perspective, what are some of the common practices in securing these networks?

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