这个程序是栈队列和链表的结合
This program is a combination of stacks queue and linked list
我不知道如何解决这个问题,我有这个作业的截止日期,你能帮我解决它吗:
The car names are saved in a linked list. The customer orders are saved in the queue. You should take order from the beginning of the queue and search for it in the linked list, then delete it and put the sold car in the stack to be able to retrieve the last sold car.
The program must be written in C language
因为你没有在你的 post 中分享你的尝试(你的代码),我在这里分享这个问题的伪代码。您应该编写自己的代码来解决您的作业。
ProcessOrder(LinkedList<CarDetails> ll, Queue<Order> Q, Stack<Order> S):
while(!Q.empty()):
Order currentOrder = Q.top()
Q.pop()
CarDetails cd = findAndDeleteFromLinkList(ll, currentOrder.car_name)
S.push(CarDetails)
现在自己写代码,可以使用以下资源:
我不知道如何解决这个问题,我有这个作业的截止日期,你能帮我解决它吗:
The car names are saved in a linked list. The customer orders are saved in the queue. You should take order from the beginning of the queue and search for it in the linked list, then delete it and put the sold car in the stack to be able to retrieve the last sold car. The program must be written in C language
因为你没有在你的 post 中分享你的尝试(你的代码),我在这里分享这个问题的伪代码。您应该编写自己的代码来解决您的作业。
ProcessOrder(LinkedList<CarDetails> ll, Queue<Order> Q, Stack<Order> S):
while(!Q.empty()):
Order currentOrder = Q.top()
Q.pop()
CarDetails cd = findAndDeleteFromLinkList(ll, currentOrder.car_name)
S.push(CarDetails)
现在自己写代码,可以使用以下资源: