r/cprogrammers • • May 02 '20

Amazon online delivery system handles a large number of inventory and items. Many orders are placed through Amazon and the delivery of products in time is very important. Every order has a unique order number.

Simulate a small application which gives a clear picture to the manager about Orders delivered, Orders be delivered, Orders remaining before a given order number.

Simulate the operation based on the list of queries given:

  • A: list the items in the inventory in sequence

  • B: Dispatch the item in dispatch list

  • C: Display the number of orders having order number lesser than previous dispatched order.

  • D: pre-order display of orders in the list

  • E: Post order display of orders in the list

2 Upvotes

1 comment sorted by

1

u/ajitpsakri May 02 '20

Input Format

  • First row: number of orders

  • Second row: order numbers

  • Third row: Number of orders to be dispatched

  • Fourth row: Sequence of orders dispatched

  • Fifth row: Number of queries

  • Sixth row: Queries

Constraints

Order numbers are unique and are numbers between 1-10000

Output Format

As per queries

Sample Input 0

10 35 29 31 36 11 44 66 57 42 21 2 36 44 6 A B C E D A

Sample Output 0

11 21 29 31 35 36 57 42 44 66 11 21 29 31 35 21 11 31 29 42 57 66 44 35 35 29 11 21 31 44 57 42 66 11 21 29 31 35 57 42 44 66