This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package stack; | |
public class StackUsingAraayClient { | |
public static void main(String[] args) throws Exception { | |
StackUsingArray stack = new StackUsingArray(5); | |
stack.push(99); | |
stack.display(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package stack; | |
public class StackUsingArray { | |
private int[] data; | |
private int top; | |
public static final int DEFAULT_CAPACITY = 10; | |
public StackUsingArray() throws Exception{ | |
this(DEFAULT_CAPACITY); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package LINkedListst; | |
public class LinkedList { | |
private class Node{ | |
int data; | |
Node next; | |
} | |
private Node head; |