Question: QUESTION 3: STACKS AND QUEUES [9pts] On the attached ZipGrade sheet answer the following questions: ZipGrade 1. A stack is LIFO while a gueue is
![QUESTION 3: STACKS AND QUEUES [9pts] On the attached ZipGrade sheet](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f2d7e770feb_01466f2d7e6b9856.jpg)
QUESTION 3: STACKS AND QUEUES [9pts] On the attached ZipGrade sheet answer the following questions: ZipGrade 1. A stack is LIFO while a gueue is FIFO B. False A. True ZipGrade 2. Assuming is an empty stack, what will be the stack contents (from bottom to top) after the given sequence of operations: s.push (1); if(s.pop ( ) % 3--1) s.push (2); s push (3) A. 2,3 C. [3,2 D. [3,1] ZipGrade 3. Assuming q is the given sequence ofoperatus, what villbthe queue contents (Crom front to back) after q.enqueue (1); q.enqueue (2) q.dequeue if (q.peek ( )-I) //look at front q.enqueue (3); ZipGrade 4. You have a stack whose internal storage is a linked list which appears in memory as 5 nul1 where x is the head of the internal storage and there is no tail pointer. Assumi with the optimal Big-O, what value is on the top of the stack? A. 5 ing the Stack class is built C. Any value 1-5 D. null E. Either 1 or 5, but not 2-4 B.1 ZipGrade 5. You have a gueue whose internal storage is a dynamic array which appears in memory as 12 3 4 5 where x is the pointer to the internal storage and additional helper values may be in the Queue class. Assuming the Queue class is built with the optimal Big-0, what value is at the front of the queue? A. 5 B. 1 C. Either 1 or 5, but not 2-4 D. Any value 1-5 E. null QUESTION 4: ITERATORS [4pts] Given a doubly-linked list with the following Node definition: class Node
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
