Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // other way is to maintain a supporting stack with the top element the lowest
- DemoStack1 stack = new DemoStack1();
- stack.push(40);
- stack.push(30);
- stack.push(20);
- System.out.println("output = "+stack.arr1[stack.top1]);
- }
- }
- class DemoStack1
- {
- int MAXLEN = 9;
- int arr[] = new int[MAXLEN];
- int arr1[] = new int[MAXLEN];
- download link:https://ouo.io/STB5n3
Add Comment
Please, Sign In to add comment