Class Stack


  • class Stack
    extends java.lang.Object
    Not yet commented.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) int i  
      (package private) int N  
      (package private) int[] v  
    • Constructor Summary

      Constructors 
      Constructor Description
      Stack​(int capacity)
      Constructs a new stack with the given capacity.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int pop()
      Returns the topmost element.
      void push​(int value)
      Places the given value on top of the stack.
      int size()
      Returns the number of elements contained.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • N

        int N
      • v

        int[] v
      • i

        int i
    • Constructor Detail

      • Stack

        public Stack​(int capacity)
        Constructs a new stack with the given capacity.
    • Method Detail

      • pop

        public int pop()
        Returns the topmost element.
      • push

        public void push​(int value)
        Places the given value on top of the stack.
      • size

        public int size()
        Returns the number of elements contained.