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

(1) please need good explanation. 4 1. 4. Answer the questions related to static

ID: 644139 • Letter: #

Question

(1) please need good explanation.
4 1. 4. Answer the questions related to static Stack and static Queue. The following codes are the member functions from static stack/queue classes respectively. Assume that all function are defined correctly and properly. With above given member functions, answer the following problems in given diagrams. Suppose the following operations are performed on an empty static stack which has four spaces to store data. There is the order : push(45) right arrow push(23) right arrow pop(x) right arrow push(45) right arrow push(33) right arrow pop(x) right arrow push(23) right arrow push(24) right arrow pop(x) right arrow pop(x) right arrow pop(x) right arrow push(7). Insert numbers in the following Figure 1 to show what will be stored in the static stack after the operations above have executed. Don't forget showing the exact position of top.

Explanation / Answer

sub0 push(45)-45 top-1

sub1 push( 23)-45 23 top-2

sub2 pop(x)-45 top-1

sub3-45 45 top-2

sub4-45 45 33 top-3

sub5-45 45 top-2

sub6-45 45 23 top-3

sub7-45 45 23 24 top-4

sub8-45 45 23 top-3

sub9-45 45 top-2

sub10-45 top-1

sub11-45 7 top-2