Stack

Stack is a subset of list(which is extended from Vector in Java) base on the LIFO ordering.

In Java, the Stack class provides five operations to achieve it: https://docs.oracle.com/javase/7/docs/api/java/util/Stack.html

  1. Push: pushes an element on the top of this stack

  2. Pop: removes the element from the top of the stack

  3. Peek: gets the top element of the stack

  4. Empty: boolean empty() returns true if the stack is empty

  5. Search: int search, searches for element in the stack, returns its offset from the top if it's found

results matching ""

    No results matching ""