I'm working on a Java exercise where I need to create a MyLinkedQueue class to handle job processing. The task involves generating 5 jobs, each with a processing unit between 1 and 6. After adding these jobs to the queue, I need to process them one at a time. Each job should be dequeued, served for 1 unit of time, and if there's any processing time left, it should be re-enqueued. If a job is finished, I want to output 'Done with job' followed by the job number. If anyone can help me understand how to implement this properly or point me in the right direction, I'd greatly appreciate it!
2 Answers
Here's a simple implementation of your MyLinkedQueue class and the processing logic. It handles the addition and removal of jobs seamlessly. Just make sure to tweak the job processing logic based on your requirements.
You might want to check out this version of the function processing jobs, as it gives you a clearer view of job management with enqueue and dequeue operations. Let me know if you'd like the complete class for better understanding!
I can post the whole class if necessary.

Wow, thanks for sharing that code! It really helped clarify things for me.