Question:

Which one of the following statements is true?

Show Hint

A stack follows the LIFO principle, and under certain conditions, it can be considered a form of priority queue.
Updated On: May 3, 2025
  • Every stack is a priority queue
  • A linear queue is empty if front = rear
  • A binary tree with n nodes will have \( \left\lfloor \frac{n}{2} \right\rfloor \) leaf nodes
  • A directed acyclic graph is a tree
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

In a stack, the last element inserted is the first element to be removed (LIFO order). This matches the behavior of a priority queue where elements are processed in a specific order, depending on their priority. Hence, every stack can be considered a priority queue under specific conditions.
Thus, the correct answer is \( \text{Every stack is a priority queue} \).
Was this answer helpful?
0
0

Top Questions on Data Structures

View More Questions