Question: #data structure you will be given the question the first picture , and you will be given the code or the resource the next four

#data structure

you will be given the question the first picture , and you will be given the code or the resource the next four pictures

#data structure you will be given the question the first picture ,and you will be given the code or the resource the nextfour pictures 2 Given the codes for "stack_02.cpp" and do the followingtasks. a) Complete the code for printLIFO() function so that it willprint all the stack item using LIFO and you must not using

2 Given the codes for "stack_02.cpp" and do the following tasks. a) Complete the code for printLIFO() function so that it will print all the stack item using LIFO and you must not using pop() function to do it. b) Complete the code for printFIFO() function so that it will print all the stack item using FIFO and you must not using pop() function to do it. The output must be exactly as follow: Push operation success item: Push operation success! iten: b Push operation success! item: FIFO printing abc LIFO printing cba MODULE & STACK 77 stack_01.cpp include Jinclude using namespace std; 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 #define MAXSTACK 10 class Stack private: int top: char data (MAXSTACK) ; public: Stack(); bool is Full(); bool isEmpty(); void push (char); char pop(); // return the popped item ); // and Stack class declaration Stack::Stack() { top = -1; } bool Stack::isPull() return (top- (MAXSTACK - 1)); } bool Stack::isEmpty() return (top = (-1)); } void Stack::push(char item) if (!isFull()) top++; data[top] = item; cout else { cout #include using namespace std; #define MAXSTACK 10 class Stack private: int top: char data (MAXSTACK) ; public: Stack() top = -1; } bool isPull(); bool isEmpty(); void push(char); void printLIFO(); void printPIPO(); ) 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 1 bool stack::isPull() return (top - (MAXSTACK - 1)); ) bool Stack::isimpty() return (top - (-1)); ) void Stack::push (char item) if (!isPull()) top++; data[top] - item; cout ) 44 ) 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 int main() Stack stack stack.push('a'); stack push('b'); stack.push('a'); cout include using namespace std; #define MAXSTACK 10 class Stack private: int top: char data [MAXSTACK]; public: Stack() { top = -1;) bool is Pull(); bool isEmpty(); void push (char): void pop(); void emptyStack(); } 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 bool Stack::isPull() return (top- (MAXSTACK - 1)); 1 bool Stack::isEmpty() 1 return (top == (-1)); 1 void stack::push(char item) if (!isFull()) top++; data[top] - item; cout

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!