What is the time-complexity of the overloaded assignment

Assignment Help C/C++ Programming
Reference no: EM13938034

Question 1

What is the time-complexity of the overloaded assignment operator?

1. O(1)

2. O(n)

3. O(log n)

4. O(n^2)

Question 2

template<class Type>
void linkedStackType<Type>::linkedOperation1()
{
nodeType<Type> *temp;

if(stackTop!=NULL)
{
temp=stackTop;
stackTop=stackTop->link;
delete temp;
}
else
cerr<<"ERROR"<<endl;
}

Question 3

Which stack operation is defined by linkedOperation1 above?

1. push

2. pop

3. top

4. copy

Question 4

template<class Type>
void linkedStackType<Type>::linkedOperation1()
{
nodeType<Type> *temp;

if(stackTop!=NULL)
{
temp=stackTop;
stackTop=stackTop->link;
delete temp;
}
else
cerr<<"ERROR"<<endl;
}

Question 5

What does it mean if stackTop equals NULL in the operation above?

1. The stack is full

2. The stack is empty

3. The element does not exist

4. The stack is nonempty but not full

Question 6

In a linear representation of a stack, which of the following values points to the top item in the stack?

1. stackTop

2. stackTop - 1

3. 0

4. -1

Question 7

#include <iostream>
#include "myStack.h"

using namespace std;

int main()
{
stackType<int> intStack(50);
stackType<int> tempStack;

intStack.push(18);
intStack.push(21);
intStack.push(25);

tempStack = intStack;

while(!tempStack.isEmptyStack())
{
cout<<tempStack.top()<<""; //output 1
tempStack.pop();
}

cout<<endl;

cout<<intStack.top()<<endl; //output 2

return 0;
}

Question 8

What is output 2 above?

1. 18

2. 21

3. 25

4. 50

Question 9

template<class Type>
Type stackType<Type>::operation2()
{
assert(stackTop != 0);
return list[stackTop - 1];
}

Question 10

Which stack operation is defined by operation2 above?

1. top

2. pop

3. push

4. isEmptyStack

Question 11

____ pointer(s) are needed to keep track of the front and rear of the queue.

1. Two

2. Three

3. Four

4. Five

Question 12

In the STL class queue the ____ function returns the number of elements in the queue.

1. num

2. count

3. sizeOf

4. size

Question 13

A technique in which one system models the behavior of another system is called ____.

1. modulation

2. comparison

3. analysis

4. simulation

Question 14

In queuing systems, queues of objects are waiting to be served by various ____.

1. operations

2. lists

3. customers

4. servers

Reference no: EM13938034

Questions Cloud

Prepare the current liabilities and long-term debt portions : Prepare the current liabilities and long-term debt portions of Craig's balance sheet at December 31, 2008. Provide a separate line item for each issue, but some items may need to be split into more than one item.
What is the sale price at kitchen hut : On August 8, 2014, Leon’s Kitchen Hut bought a set of pots with a $136 list price from Lambert Manufacturing. Leon’s receives a 30% trade discount. Terms of the sale were 2/10, n/30. On August 14, Leon’s sent a check to Lambert for the pots. What is ..
Acting on both axis strain in both axis : A plate of uniform thickness 15 mm and 200mm by 300mm if subjected to a force of 450 KN in the x and y axis. Calcualte the stresses acting on both axis strain in both axis. Take Young's Modules to be 209GPa and Poisson's ration to be 0.3
What is the market value of the firm prior to the recap : An all equity business has 100million shares outstanding selling for $20 a share. Management believes that interest rates are unreasonably low and decides to execute a leveraged recapitalization. It will raise $1 billion in debt and repurchase 50 mil..
What is the time-complexity of the overloaded assignment : What is the time-complexity of the overloaded assignment operator
Prepare a scatter graph of loan processing cost : Estimate total profit in a month when 275 loans are processed. (Round to the nearest dollar.)
New firm in a rapidly growing industry : The Bell Weather Co. is a new firm in a rapidly growing industry. The company is planning on increasing its annual dividend by 21 percent a year for the next 4 years and then decreasing the growth rate to 5 percent per year. The company just paid its..
The area of the triangle whose vertices : Find the maximum and minimum values of f. (c) Sketch the graphs of f and f 0 (by hand) on separate xy-planes. Discuss briefly what is happening at x = -1 and x = 1. (d) Repeat (a) and (b) for the same f, but now with -2 ≤ x ≤ -1.
Different organisational structures and cultures : Compare and contrast two different organisational structures and cultures. Explain how the relationship between an organisation‘s structure and culture can influence on the performance of the Asda's activities at this Irish site

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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