Stacks - Quiz

  • AA data structure that allows elements to be inserted and removed in any order
  • BA data structure that allows elements to be inserted and removed from the beginning or end
  • CA data structure that allows elements to be inserted and removed from one end only
  • DA data structure that allows elements to be inserted and removed from both ends
  • APush and pop
  • BInsert and delete
  • CEnqueue and dequeue
  • DSort and search
  • AArray
  • BLinked list
  • CBinary tree
  • DHash table
  • AThe stack remains unchanged
  • BAn error occurs
  • CThe top element is returned with no change to the stack
  • D The bottom element is returned with no change to the stack
  • AReversing a string
  • BUndoing an operation in a text editor
  • CEvaluating arithmetic expressions
  • D Storing data in a database
  • AIt allows for efficient insertion and deletion at any position
  • B It allows for efficient searching and sorting of elements
  • C It follows the First-In-First-Out (FIFO) principle
  • DIt allows for efficient insertion and deletion at the top end
  • ASorting a list of integers
  • BFinding the shortest path between two nodes in a graph
  • CEvaluating arithmetic expressions
  • DGenerating all possible subsets of a set
  • AIt can only store a limited number of elements
  • B It is not efficient for searching or sorting elements
  • CIt requires a lot of memory to implement
  • DIt can lead to stack overflow errors if the stack becomes too large
  • A Checking if a sentence is a palindrome
  • BSolving a maze
  • CEvaluating the postfix notation of an arithmetic expression
  • DStoring data in a database