1) Come up with an example of a software application in which the data elements must be processed in 'last in, first out' order like a stack
or
in 'first in, first out' order like a queue.
Remember: we can think of these data structures as abstract in terms of how they store that comes in and leaves, and they could be implemented internally with arrays or linked lists, etc... The important thing here is the needs of the problem.
Any ticket booking system uses QUEUE as their data structure to process data. Because the persons who book first get the ticket first. So it is using the first-in, first-out structure.
The UNDO operation in any text-editor uses the STACK as its data structure. Because in this operation the last written item gets deleted first. So it is using last-in, first-out structure.
1) Come up with an example of a software application in which the data elements must...