Stacks - Quiz

  • A The stack remains unchanged
  • B An error occurs
  • C The top element is returned with no change to the stack
  • D The bottom element is returned with no change to the stack
  • A Push and pop
  • B Insert and delete
  • C Enqueue and dequeue
  • D Sort and search
  • A Sorting a list of integers
  • B Finding the shortest path between two nodes in a graph
  • C Evaluating arithmetic expressions
  • D Generating all possible subsets of a set
  • A Checking if a sentence is a palindrome
  • B Solving a maze
  • C Evaluating the postfix notation of an arithmetic expression
  • D Storing data in a database
  • A Array
  • B Linked list
  • C Binary tree
  • D Hash table
  • A A data structure that allows elements to be inserted and removed in any order
  • B A data structure that allows elements to be inserted and removed from the beginning or end
  • C A data structure that allows elements to be inserted and removed from one end only
  • D A data structure that allows elements to be inserted and removed from both ends
  • A It can only store a limited number of elements
  • B It is not efficient for searching or sorting elements
  • C It requires a lot of memory to implement
  • D It can lead to stack overflow errors if the stack becomes too large
  • A It 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
  • D It allows for efficient insertion and deletion at the top end
  • A Reversing a string
  • B Undoing an operation in a text editor
  • C Evaluating arithmetic expressions
  • D Storing data in a database