Which of the following operations is not supported by a standard stack?
Practice Questions
Q1
Which of the following operations is not supported by a standard stack?
Push
Pop
Peek
Dequeue
Questions & Step-by-Step Solutions
Which of the following operations is not supported by a standard stack?
Step 1: Understand what a stack is. A stack is a data structure that follows the Last In, First Out (LIFO) principle.
Step 2: Learn about the operations supported by a stack. The main operations are 'push' (adding an item), 'pop' (removing the top item), and 'peek' (viewing the top item without removing it).
Step 3: Identify the operation that is not supported by a stack. The operation 'dequeue' is used in queues, which is a different data structure that follows the First In, First Out (FIFO) principle.
Step 4: Conclude that since 'dequeue' is specific to queues, it is not supported by a standard stack.