Queues - Quiz

  • 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 in postfix notation
  • D Implementing a binary search algorithm
  • A A queue follows the Last-In-First-Out (LIFO) principle, while a stack follows the First-In-First-Out (FIFO) principle.
  • B A queue allows elements to be inserted and removed from both ends, while a stack only allows elements to be inserted and removed from one end.
  • C A queue is typically implemented using a linked list, while a stack is typically implemented using an array.
  • D A queue is used for breadth-first search algorithms, while a stack is used for depth-first search algorithms.
  • A Processing tasks in the order they are received
  • B Implementing a breadth-first search algorithm in a graph
  • C Storing data in a database
  • D Printing documents in the order they are sent to a printer
  • A The queue remains unchanged
  • B An error occurs
  • C The front element is returned with no change to the queue
  • D The rear element is returned with no change to the queue
  • 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 at one end and removed from the other end
  • 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 Last-In-First-Out (LIFO) principle
  • D It allows for efficient insertion and deletion at both ends
  • A Priority queue
  • B Circular queue
  • C Double-ended queue
  • D Binary queue
  • A Array
  • B Linked list
  • C Binary tree
  • D Hash table