Problem on stack

Assignment Help Computer Engineering
Reference no: EM132360

Question

Suppose that 'Stack' is the class explained in this section with 'StackType' set to int and STACK_CAPACITY or myCapacity set to 5. Give value of 'myTop' and contents of array referred to by 'myArray' in the Stack s after code segment is performed, or show why a mistake occurs.

1. Stack s; 5. Stack s;
s.push(123); s.push(111);
s.push(456); i = s.top();
s.pop(); s.push(222);
s.push(789); s.pop();
s.pop(); s.push(i);

2. Stack s;
for(int i = 0;i < 5;i++)
s.push(2*i);
s.pop();
s.pop();

 

Reference no: EM132360

Questions Cloud

Describe how left explanation is useful while formatting : Describe how left explanation is useful while formatting
How to store ten floating-point values into vector : How to store ten floating-point values into vector. Write down a program that declares a vector of ten floating-point values
How to generate 2 instances of time and date : generate an application that uses both Time and Date classes How to generate 2 instances of Time and Date
Explain examples of type of knowledge industry : Explain examples of type of knowledge industry
Problem on stack : Problem on Stack
Complete the subsequent tax returns : Complete the subsequent tax return's
Prepare journal entries using the completed contract method : Prepare journal entries for 2010 using the Completed-contract method.
What is the air concentration relative to the osha pel : What is the requirement before the use of the sampling pump, Give three ways how it can be achieved What is the air concentration relative to the OSHA PEL, Express your answer in ppm List down five requirements of a sample train check list
How would the selling price of the bonds be evaluated : How would the selling price of the bonds be evaluated

Reviews

Write a Review

Computer Engineering Questions & Answers

  What profit do you see with partitioned view

Explain your idea for a database along with your thoughts for a partitioned view. 1. How will you use this partitioned view?

  Speed routing protocol

Following question is related to SPEED routing protocol-Multiple speeds are computed in MAC layer. The forwarder with highest speed is selected on MAC layer feedback. This selection could not produce a shortest path.

  Implementation of type data structures

How can string and word variable type data structures be implemented?

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  How to enlarge the size of the array

How to enlarge the size of the array? Enlarge the size of the array to 25. Driver will start with 10 objects in it other than has provision for up to 15 new objects. You can use java any API.

  How to illustrate a memory map for a system

Illustrate a memory map for a system with a memory capability of 512MB. Each memory location in system is 8 bits.

  How to plan a wan network linking a toy manufacturing plant

How to plan a WAN network linking a toy manufacturing plant? Plan a WAN network linking a toy manufacturing plant (located in Dallas Texas) with two division centres (Los Angeles, California and Pittsburgh, Pennsylvania)

  What will be formula of digital certificate of the server

Point out what will be the formula of digital certificate of the server N. we denote the public and private keys of server N as K+ ,N KN, and public or private keys of CA are denoted as K+ CA KCA.

  Write pseudo code - program and draw flow chart

Write pseudo code, program and draw flow chart for programs

  Library management system

Prepare a module which can exhibit the Library Management System

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  How to create a set in third normal

How to create a set in third normal RESERVATION(reservation id, date of reservation, start date, end date, (( customer id, customer name, customer address, customer type, customer type description, ((customer preferences)), customer credit card n..

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