Cards (15)

  • Stack
    • is linear data structure that follows LIFO principle which means that the last element added to the stack is the first one to be removed.
  • Push
    1. adds an element to the top of the stack
  • Pop
    removes the top element of the stack.
  • Peek (Top)
    returns the top element without removing it.
  • isEmpty
    1. checks if the stack is empty.
  • Expression evaluation
    1. used in compilers to evaluate expressions like (a+b) * c
  • Undo/Redo Functionality

    applications like text editors use stacks to track changes
  • Function Call Management
    when a function is called, its execution details are stored in a stack.
  • Backtracking

    used in solving problems like mazes, navigating webpages (browser back button), and recursion.
  • STACK
    Used when elements are need to be managed in reverse order
  • Stacks are widely used in programming including:
    1. Expression evaluation
    2. Undo/Redo Functionality
    3. Function Call Management
    4. Backtracking
  • Expression evaluation
    used in compilers to evaluate expressions like (a+b) * c
  • Undo/Redo Functionality
    applications like text editors use stacks to track changes
  • Function Call Management
    when a function is called, its execution details are stored in a stack.
  • Backtracking
    used in solving problems like mazes, navigating webpages (browser back button), and recursion.