+1 vote
in Data Structures & Algorithms I by (110k points)
Which of the following real world scenarios would you associate with a stack data structure?

(a) piling up of chairs one above the other

(b) people standing in a line to be serviced at a counter

(c) offer services based on the priority of the customer

(d) tatkal Ticket Booking in IRCTC

Enquiry is from Stack using Array in division Abstract Data Types of Data Structures & Algorithms I

I have been asked this question in examination.

1 Answer

+1 vote
by (412k points)
selected by
 
Best answer
Correct option is (a) piling up of chairs one above the other

Best explanation: Stack follows Last In First Out (LIFO) policy. Piling up of chairs one above the other is based on LIFO, people standing in a line is a queue and if the service is based on priority, then it can be associated with a priority queue. Tatkal Ticket Booking Follows First in First Out Policy. People who click the book now first will enter the booking page first.

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.

Categories

...