Stack
Tuesday, 21 June 2011
import java.util.*;
public class StackDemo {
public static void main(String[] args) {
Stack s=new Stack();
s.push("A");
s.push("B");
s.push("C");
System.out.println(s);
System.out.println(s.capacity());
System.out.println(s.search("C"));
System.out.println(s.search("B"));
System.out.println(s.search("A"));
System.out.println(s);
}
}
public class StackDemo {
public static void main(String[] args) {
Stack s=new Stack();
s.push("A");
s.push("B");
s.push("C");
System.out.println(s);
System.out.println(s.capacity());
System.out.println(s.search("C"));
System.out.println(s.search("B"));
System.out.println(s.search("A"));
System.out.println(s);
}
}
0 comments:
Post a Comment