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

  Finding a spanning tree with minimum sum of arc weights

Provide an O(N2), implementation of this algorithm. Hint: Together with the kth fragment Fk, maintain for each j /∈ Fk the node nk(i) ∈ Fk such that the arc connecting j and nk(i) has minimum weight

  Degrees in fahrenheit

They need a program that will convert Fahrenheit to Celsius. The user will enter the degrees in Fahrenheit and the program will give the results in Celsius.

  Compare the types of computers

compare desktop and laptop, Introduce this two type of computer to the audience.

  Find the values of a and b such that error is minimized

Find the values of A and B such that error is minimized. What power of h is the error proportional to?

  An overview of wireless lan security

Write a term paper on the topic "An overview of wireless LAN Security" with the help of below references. This paper must contain citations and must be 2000-4000 words long.

  Write a program in vb using repetition

Write a program in VB using repetition's such as a do loop that will display the results when a button is clicked.

  Multiple sources and integrate it into a cohesive paper

You will need to make sure to identify the appropriate research question, identify key terms for performing electronic searches, organize your data, obtain data or information from multiple sources and integrate it into a cohesive paper.

  According to the lecture topics and materials

Select a particular network security or associated topic according to the lecture topics and materials. You need to conduct extensive reading, then write a report based on your understanding of this particular topic. A research report consists of ..

  Statement into machine language of appendix

Translate the following high level statement into machine language of Appendix A with brief comments, assuming A, B, C and D are variables in 2‘s complement notation each using one byte in memory. Assume also they occupy addresses AA, BB, CC and D..

  Summarizing and describing the information

Write a 1,000 word paper in APA format, summarizing and describing the information you found about tips on how to create digital presentations and how to create online presentations. Include at least 3 citations and references.

  Create a hierarchy chart depicting the chosen situation

Create a hierarchy chart depicting the chosen situation, develop a flowchart and provide a brief explanation for it and develop an algorithm and provide a brief explanation for it.

  What is the vulnerabilities of information system conference

What is the Vulnerabilities of information system Conference?

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