Hello all, this is actually my first post on this threat, but I really need the help. I currently have an assignment for my CS1 class where we are to create a queue for a carwash by reading a txt file for different times cars tried to get into a queue of max = 5 cars. I decided to use linked lists instead of a circular queue just because I am more comfortable with it. My issue is this: I have all the functions set up and I can scan the file just fine, but I just dont know when to dequeue. When I dequeue right after I enqueue, then the next car does not go into the queue since there is no car in front of it! So am I supposed to create an additional node as the car bay? Below is an example of the exercise:
txt file: (first number is the time or arrival and second is the car ID)
10 44
15 56
30 64
...
output: (by the way, the time per wash is 10 mins)
10 arrival 44
15 arrival 56
20 departure 44
25 departure 56
30 arrival 64
...
I apologize if my explanation is confusing, but I would appreciate any help. From what I understand, this is a popular example in CS classes.
Thank you very much.