¡GoConqr estrena diseño! Cuéntanos qué te parece.

Mapa mental

Stack(for mid term)

abhay jagetiya Inglés

Contenido del mapa

Stack(for mid term)

  1. follows Last In First Out or First In Last Out

  2. Stack class extends class Vector with five operations that allow a vector to be treated as a stack.

    • push(item)
      • Pushes an item onto the top of this stack
    • pop()
      • Removes the object at the top of this stack and returns that object as the value of this function.
      • throws EmptyStackException - if stack is empty.
    • peek()
      • Looks at the object at the top of this stack without removing it from the stack.
      • EmptyStackException - if this stack is empty.
    • empty()
      • true if and only if this stack contains no items; false otherwise.
    • search(object o)
      • the 1-based position from the top of the stack where the object is located; the return value -1 indicates that the object is not on the stack.
      • he topmost item on the stack is considered to be at distance 1
  3. Constructor

    • Stack() ... Creates an empty Stack.
  4. it also inherits many methods from class java.util.vector and java.lang.object

  5. create stack

    • import java.util.stack package
      • Stack<E> stack = new Stack<E>();
  6. print stack

    • System.out.println(stack);
      • elements are printed in order from bottom to top
  7. exceptions

    • Underflow: Trying to pop/peek an element from an empty stack
    • Overflow: Trying to push an element into a stack that is already at its maximum capacity
  8. parenthesis matching problem

    • mug up entire code
    • more topics in module
  9. file versioning system

    • understand given code thoroughly
  10. implementing stack

    • using Array, arraylist and linked list

Información

Descripción
Mapa Mental sobre Stack(for mid term), creado por abhay jagetiya el 06/10/2021.
Creado por
abhay jagetiya
Visitas
0
Valoración

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?