Which data structure resembles the behavior of a stack?

  • Linked List
  • Queue
  • Stack
  • Tree
The data structure that most closely resembles the behavior of a stack is a queue. While a stack follows the Last In, First Out (LIFO) principle, where the last element added is the first one to be removed, a queue follows the First In, First Out (FIFO) principle, where the first element added is the first one to be removed. Queues are often used in scenarios such as managing processes in operating systems, implementing printer spooling, and handling requests in network communication.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *