银行排队问题之单队列多窗口服务
这是以前写的一道题,题目记不清了,是PTA上的,所以题干应该都差不多,思路都在注释里了
#include <iostream>
using namespace std;
#define MAXSIZE 2000
typedef struct {
int P;
int T;
}people;
typedef struct {
int time;
int num;
int finishtime;
}window;
typedef struct {
people* base;
int front;
int rear;
}Queue;
void InitQueue(Queue& Q) {
Q.base = (people*)malloc(MAXSIZE * sizeof(people));
if (!Q.base) exit(0);
Q.front = Q.rear = 0;
}
void EnQueue(Queue& Q, people p) {
if ((Q.rear + 1) % MAXSIZE == Q.front)
exit(0);
Q.base[Q.rear] = p;
Q.rear = (Q.rear + 1) % MAXSIZE;
}
void DeQueue(Queue& Q, people<

本文探讨了一个银行排队问题的解决方案,采用单队列多窗口服务模式,通过算法优化客户等待时间,减少排队现象,提高服务质量。文章详细介绍了算法的实现过程,包括客户入队、窗口服务时间计算、排队时间统计等关键步骤。
 【详解】&spm=1001.2101.3001.5002&articleId=105562484&d=1&t=3&u=85c980b2c23847639e463e5e2c5ef6fe)
2153

被折叠的 条评论
为什么被折叠?



