Question: QUESTION 2 (25 Marks) o Instructions to STACK functionalities Table 02 STACK states table 1 STACK SIZE 2 STACK MONITORING INDICATOR item positions TOP STACK
QUESTION 2 (25 Marks) o Instructions to STACK functionalities Table 02 STACK states table 1 STACK SIZE 2 STACK MONITORING INDICATOR item positions TOP STACK IS FULL STACKS EMPTY 0 1 COMMENTS Q. INITIAL STATE 1. Create Stack 2. Push 'A' 3. Push B 4 Push 'c 5. Pop 1 ITEM 6. Pop 1 ITEM 7. Pop 1 ITEM Table Q2 shows states of STACK of Size = 2 when instructions are performed on it. The table is divided into four(4) main columns listed as follows: Column 0 Seven (7) instructions to be performed on STACK where Column 1 : possible positions of items in STACK Data Structures ECD12110CEE) FEB 2021(MAIN) 3/5 Column 2 : STACK monitoring indicators consisting of status columns for TOP, STACK IS FULL, and STACK IS EMPTY, respectively Column 3 : COMMENT space where relevant notes can be put in Answer the following questions: (a) Develop pseudo code for StackCreate function (2 marks) (b) Develop pseudo code for Stackisfull function; (2 marks) (c) Develop pseudo code for StackPush function (3 marks) (d) Develop pseudo code for StackIsEmpty function; (2 marks) (e) Develop pseudo code for StackPop function (5 marks) () Apply all instructions listed in Table and mark all states of STACK on each row accordingly. Write any note under the comment column at relevant row. (11 marks)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
