Dsa
Queue
Easy
Resource Allocation Queue
You are managing a resource allocation system where tasks are assigned resources in order. Each task requests a number of resources, and you need to calculate the order in which they will be fulfilled based on their submission order. Output the resources assigned in the order they were requested. Each line contains the number of resources requested.
Input Format:
- The first line contains an integer N (1 ≤ N ≤ 1000), the number of tasks.
- The next N lines contain integers R (1 ≤ R ≤ 100), the resources requested by each task.
Output Format:
- Output the resources in the order they were requested, separated by spaces.
Example:
Input:
3
5
3
8
Output:
5 3 8
Key concepts
queueresource management
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now