(1) PUSH (a) STACK (2) FIFO (b) Stack insertion (3) POP (c) QUEUE (4) LIFO (d) Stack deletion
This question requires matching terms related to fundamental data structures, namely STACK and QUEUE, with their corresponding operations and properties.
A STACK is a linear data structure that follows a particular order in which operations are performed. The order is LIFO (Last-In, First-Out). The main operations associated with a stack are:
The principle governing a stack is LIFO (Last-In, First Out), meaning the last element added is the first one to be removed.
A QUEUE is another linear data structure that follows a specific order for operations. It operates on the FIFO principle.
Based on the definitions above, we can establish the following matches:
Therefore, the correct matching is (1)-(b), (2)-(c), (3)-(d), (4)-(a).
| Item | Description | Match |
|---|---|---|
| (1) PUSH | Operation to add an element to a stack | (b) Stack insertion |
| (2) FIFO | First-In, First-Out principle | (c) QUEUE |
| (3) POP | Operation to remove an element from a stack | (d) Stack deletion |
| (4) LIFO | Last-In, First-Out principle | (a) STACK |
Single array a[0: MAXSIZE - 1] is used to implement two stacks. The two stacks grow from apposite ends of the array. Variables top 1 and top 2 (top1 < top2) point to the location of the topmost element in each of the stacks if the space is to be used efficiently, The condition for "stack full" is____________.
Stack is also known as