Question: 01) Three passengers are waiting for an elevator in different floors of a 6-story building The elevator must stop at the floors as follows: a)

 01) Three passengers are waiting for an elevator in different floors

01) Three passengers are waiting for an elevator in different floors of a 6-story building The elevator must stop at the floors as follows: a) Passenger 1 is at 1" floor and he presses the elevator button as the first person. He wants to go to 34 floor. b) Passenger 2 is at 2nd floor and he presses the elevator button as the second person. He wants to go to 4th floor, c) Passenger I gets off the elevator when the elevator gets to 3d floor d) Passenger 3 is at 4th floor and he presses the elevator button as the third person. He wants to go to 1" floor, e) Passenger 2 gets off the elevator when the elevator gets to 4 floor, 1) The elevator moves toward first floor where passenger 3 gets off the elevator, Write a C program that uses linked lists or stacks to pick up the passengers or drop them off at the desired floors. Draw the block diagram of your linked list or stack at each step. hint: In the beginning and at the end, the clevator is empty hint: you can use either the floor number or the passenger number as the data member of your structure, hint: getting in to the elevator is equivalent to inserting a node and getting off the clevator is equivalent to removing a node 01) Three passengers are waiting for an elevator in different floors of a 6-story building The elevator must stop at the floors as follows: a) Passenger 1 is at 1" floor and he presses the elevator button as the first person. He wants to go to 34 floor. b) Passenger 2 is at 2nd floor and he presses the elevator button as the second person. He wants to go to 4th floor, c) Passenger I gets off the elevator when the elevator gets to 3d floor d) Passenger 3 is at 4th floor and he presses the elevator button as the third person. He wants to go to 1" floor, e) Passenger 2 gets off the elevator when the elevator gets to 4 floor, 1) The elevator moves toward first floor where passenger 3 gets off the elevator, Write a C program that uses linked lists or stacks to pick up the passengers or drop them off at the desired floors. Draw the block diagram of your linked list or stack at each step. hint: In the beginning and at the end, the clevator is empty hint: you can use either the floor number or the passenger number as the data member of your structure, hint: getting in to the elevator is equivalent to inserting a node and getting off the clevator is equivalent to removing a node

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!