Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

PLEASE HELP TO ANSWER MUTIPLE CHOICE PLASE 100% RIGHT !!!!!!!!!!!!!! Week 3 : St

ID: 645437 • Letter: P

Question

PLEASE HELP TO ANSWER MUTIPLE CHOICE PLASE 100% RIGHT !!!!!!!!!!!!!!

Week 3 : Stack and Queue ADTs - Quiz

       The element that was inserted first
       The last inserted element
       The element at the root of the tree


       The pivot

Question 1.1. (TCO 3) Which is the last element in a stack that will be removed? (Points : 3)

       The element that was inserted first
       The last inserted element
       The element at the root of the tree


       The pivot

Question 2.2. (TCO 3) If the numbers 9, 17, 21, and 34 are inserted in that order in a stack, which will be the first element to be removed?(Points : 3)        9
       17
       21
       34 Question 3.3. (TCO 3) Which item in the stack is to be removed first? (Points : 3)        The item at the top
       The item at the bottom
       The second item
       None of the above Question 4.4. (TCO 3) Which is the stack operation implemented in the following function? The variable n represents the stack top.

int operation()
{
    return list[n-1];
} (Points : 3)        Peek
       Push
       Pop
       The constructor of the class Stack Question 5.5. (TCO 3) Consider the following program.

Stack s;
s.push(1);
s.push(2);
s.push(3);
s.push(4);
s.pop();
s.pop();
s.pop();
cout << s.peek() << endl;

Which is the value displayed by the cout statement? (Points : 4)        1
       2
       3
       4 Question 6.6. (TCO 3) If the numbers 9, 17, 21, and 34 are inserted in that order in a queue, which will be the first element to be removed?(Points : 4)        9
       17
       21
       34 Question 7.7. (TCO 3) The _____ is a data structure that satisfies the FIFO (first in, first out) principle. (Points : 4)        linked list
       array-based list
       stack
       queue Question 8.8. (TCO 3) Consider the following program.

Queue q;
q.insert(1);
q.insert(2);
q.insert(3);
q.dequeue();
cout << q.getFront() << endl;

Which is the value displayed by the cout statement? (Points : 4)        0
       1
       2
       3 Question 9.9. (TCO 3) Consider the following program.

Queue q;
q.insert(1);
q.insert(2);
q.insert(3);
q.insert(4);
cout << q.getFront() << endl;

Which is the value displayed by the cout statement? (Points : 4)        1
       2
       3
       4 Question 10.10. (TCO 3) Consider the following program.

Queue q;
q.insert(1);
q.insert(2);
q.insert(3);
q.insert(4);
q.dequeue();
q.dequeue();
cout << q.getFront() << endl;

Which is the value displayed by the cout statement? (Points : 4)        1
       2
       3
       4 Question 11.11. (TCO 3) In the _____ ADT, insertions and deletions occur at the top of the list of elements. (Points : 4)        stack
       queue
       linked list
       binary search tree

Explanation / Answer

Ans 1) The last inserted element

Ans 2) 34

Ans 3) The item at the top

Ans 4) Peek

Ans 5) 1

Ans 6) 9

Ans 7) queue

Ans 8) 2

Ans 9) 1

Ans 10) 3

Ans 11) stack

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote