1. (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
2. (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
3. (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 : 3)
1
2
3
4
4. (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 : 3)
9
17
21
34
5. (TCO 3) Which is the queue operation implemented in the following function? The variable count represents the number of elements in the queue.
operation()
{
front = 0;
back = size-1;
count = 0;
} (Points : 3)
Enqueue
Dequeue
Queue initialization
Search
6. (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 : 3)
1
2
3
4
7. (TCO 3) In the queue data structure, _____. (Points : 3)
insertions occur at the back and deletions occur at the front
insertions occur at the front and deletions occur at the back
insertions and deletions occur at the top
insertions and deletions occur at any end of the queue
8. (TCO 3) An effective way to implement a priority queue is to use a _____. (Points : 3)
stack
heap
file
list
* You can also use 2CO option if you want to purchase through Credit Cards/Paypal but make sure you put the correct billing information otherwise you wont be able to receive any download link.
* Your paypal has to be pre-loaded in order to complete the purchase or otherwise please discuss it with us at support@iqrajavaid.com.
* As soon as the payment is received, download link of the solution will automatically be sent to the address used in selected payment method.
* Please check your junk mails as the download link email might go there and please be patient for the download link email. Sometimes, due to server congestion, you may receive download link with a delay.
* All the contents are compressed in one zip folder.
* In case if you get stuck at any point during the payment process, please immediately contact us at support@iqrajavaid.com and we will fix it with you.
* We try our best to reach back to you on immediate basis. However, please wait for atleast 8 hours for a response from our side. Afterall, we are humans.
* Comments/Feedbacks are truely welcomed and there might be some incentives for you for the next lab/quiz/assignment.
* In case of any query, please donot hesitate to contact us at support@iqrajavaid.com.
* MOST IMPORTANT Please use the tutorials as a guide and they need NOT to be used for any submission. Just take help from the material.
******************************************** Good Luck ***************************************************
Any personal information received will only be used to fill your order. We will not sell or redistribute your information to anyone.
We will try our best to resolve the issue and if still persists we can discuss for a refund in case its required.