#include <stdio.h>
#include <cstdlib>
#include <time.h>
#include <string>
#include <windows.h>
#include <iostream>
using namespace std;
typedef struct Node {//创建进程控制块
char name[10];//进程名
int demand_time;//进程要求运行时间
int run_time;//进程已运行时间
char state;//进程的状态,初始状态都为"就绪",用"R"表示,
//当一个进程运行结束后,它的状态为"结束",用"E"表示。
struct Node *next;//指向下一个结点的指针
}*LinkList, LNode;
LinkList head, tail;//定义头指针,尾指针
int n;//进程数
void CreateList()//创建循环链表
{
head = (LinkList)malloc(sizeof(LNode));
tail = (LinkList)malloc(sizeof(LNode));
#include <cstdlib>
#include <time.h>
#include <string>
#include <windows.h>
#include <iostream>
using namespace std;
typedef struct Node {//创建进程控制块
char name[10];//进程名
int demand_time;//进程要求运行时间
int run_time;//进程已运行时间
char state;//进程的状态,初始状态都为"就绪",用"R"表示,
//当一个进程运行结束后,它的状态为"结束",用"E"表示。
struct Node *next;//指向下一个结点的指针
}*LinkList, LNode;
LinkList head, tail;//定义头指针,尾指针
int n;//进程数
void CreateList()//创建循环链表
{
head = (LinkList)malloc(sizeof(LNode));
tail = (LinkList)malloc(sizeof(LNode));

该博客介绍了一个使用C++实现的时间片轮转调度算法,通过创建进程控制块结构并模拟运行过程,展示了如何在循环链表中进行进程状态管理与更新。文章包含创建链表、显示进程信息、运行算法以及删除已完成进程等功能。

2万+

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



