Ila Shukla 22030121093 Assignment 3
Ila Shukla 22030121093 Assignment 3
Ila Shukla 22030121093 Assignment 3
Stack.java
package MyDataStructure;
public class Stack {
private int maxSize;
private int top;
private int[] stackArray;
Queue.java
package MyDataStructure;
public class Queue {
private int maxSize;
private int front;
private int rear;
private int[] queueArray;
DemoDataStructure.java
package DemoPack;
// Demonstrate stack
stack.push(1);
stack.push(2);
stack.push(3);
stack.printStack();
stack.pop();
stack.printStack();
// Demonstrate queue
queue.insert(10);
queue.insert(20);
queue.insert(30);
queue.printQueue();
queue.delete();
queue.printQueue();
}
}
Output-