Which of the following is true of stacks and queues? a) A stack is a last-in, fi
ID: 3633047 • Letter: W
Question
Which of the following is true of stacks and queues?a) A stack is a last-in, first-out structure, and a queue is a first-in, first-out structure
b) A stack is a first-in, first-out structure, and both structures are random access structures.
c) A stack is a last-in, first-out structure, and a queue is a random access structure.
d) A queue is a last-in, first-out structure, and a stack is a first-in, first-out structure.
Look at the following class heading:
class CountedQue : public QueType
What does the phrase : public QueType mean?
a) QueType is being substituted for CountedQue
b) QueType is being derived from CountedQue
c) CountedQue is being substituted for QueType
d) CountedQue is being derived from QueType
If CountedQue is derived from QueType, what operator goes in the blank?
void CountedQue::Dequeue(ItemType& item)
{
length--;
QueType______Dequeue(item);
}
a) :
b) ->
c) ::
d) ==
What is the role of the expression : QueType in the following constructor?
CountedQue::CountedQue(max) : QueType(max)
{
length = 0;
}
a) causes the invocation of the base-class constructor
b) causes the invocation of the derived-class constructor
c) says to execute the base-class constructor, then the derived-class constructor
d) says to execute the derived-class constructor, then the base-class constructor
What is the expression : QueType() called?
CountedQue::CountedQue() : QueType()
{
length = 0;
}
a) base-class initializer
b) derived-class initializer
c) constructor initializer
Explanation / Answer
Here is the correct answer:
1) is the only one that is correct. it is "A"
2) is "D" CountedQue is being derived from QueType
3) is "C" ::
4) is "A" Causes the invocation of the base-class constructor
5) is "C" Constructor initializer
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.