Question: I need to implement raw array Stack for create empty stack, isEmpty, isFull, push, pop, and size using below pseudo code. I need two classes

I need to implement raw array Stack for create empty stack, isEmpty, isFull, push, pop, and size using below pseudo code. I need two classes with stack pseudo code implementation and the main method to demonstrate the correct working of each operation.

pseudo code

StackADT (using raw array)

class StackADT {

int top

int items[]

int max

StackADT(int n)

Initialize array to n capacity

top = 0

max = n

boolean isEmpty()

if array has no elements return true else return false

boolean isFull() {

if array is full return true else return false

void push(int item)

if (isFull()) throw exception

add item to items[top] increment top

int pop()

if (isEmpty()) throw exception

decrement top

return top element from array

int size()

return number of elements

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!