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

  Problem regarding the complexity of algorithm

If a d-heap is stored as an array, for an entry located in position i, where are the parents and children?

  Various threats to information security in your view

What are the various threats to information security in your view? Are you doing your share to protect your information? Why and why not? What can you do to improve your information security practices?

  What is the sum after the following loop terminates

What is the sum after the following loop terminates

  To the ratio of packet size to packet header size

How accurate do you think this model of the relative merits of circuits and packets is? Does it ignore important considerations that discredit one or the other approach? If so, what are they?

  Program using a loop that multiplies two non-negative number

Write code to implement the expression: A= (B + C) * (D - E) on 3-, 2-, 1- and 0-address machines. In accordance with programming language practice, computing the expression should not change the values of its operands.

  Discuss instantiating a thread in java

What methods are available for managing threads & how do we use them?

  What strategic role can information play in business process

What strategic role can Information play in business process re-engineering

  Determining the important terminology

Give a short overview of the topic(s) covered; include as many details as necessary to make the topic(s) clear. Explain any important terminology covered (including any terms that are new to you).

  Database schema for a customer sale

Database schema for a customer sale database scenario: customer(cust_id,cust_name) primary key(cust_id). Item(item_id,item_name,price) primary key(item_id)

  It consultant

Choose a small local business and assume the role of an IT consultant for them. The business is growing and the owners have told you that they "want to stay relevant, technologically speaking." Consider what a small business might need, and explor..

  Write a presentation on health information technology

The Department of Health and Human Services (HHS) provides extensive information about the Health Insurance Portability and Accountability Act (HIPAA). In March 2012, the HHS settled a HIPAA case with the Blue Cross Blue Shield of Tennessee (BCBST..

  What is the purpose of multiplexing

What is the purpose of multiplexing

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