Question: Section 4 (10 points) public class Stack private int maxSize; private int[] stackArray, private int top: public Stack(ints) { maxSize = 5: stackArray = new
Section 4 (10 points) public class Stack private int maxSize; private int[] stackArray, private int top: public Stack(ints) { maxSize = 5: stackArray = new int(maxSize): top = -1; Based on the above class declaration, write the following methods. Q18. Write isEmpty (boolean method) that checks if the stack is empty or not. (3 points) Q19. Write is Full (boolean method) that checks if the stack is full or not. (3 points) Q20. Write push (void method) that add a new element on top of stack. (4 points)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
