Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int p2 = n;
- push (Object data) {
- if (p1 + p2 == n)
- throw new StackOverFlow exeption
- else {
- p2--;
- arr[p2] == data;
- }
- }
- Object pop () {
- if (!isEmpty()) {
- Object data = arr[p2];
- p2++;
- return data;
- }
- }
- boolean isEmpty() {
- if (p2 >= n)
- return true;
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement