🎨 format file

This commit is contained in:
Kim Yang
2020-08-14 04:44:10 +08:00
parent 55af098154
commit ce38701c86
25 changed files with 325 additions and 55 deletions

View File

@@ -1,5 +1,6 @@
//
// Created by kim yang on 2020/8/3.
// Copyright (c) Kim Yang All rights reserved.
//
//链式队列(带头节点版本)
@@ -7,6 +8,8 @@
#include <stdio.h>
#include <stdlib.h>
/**定义模块**/
typedef struct LinkNode {
int data;
struct LinkNode *next;
@@ -15,7 +18,9 @@ typedef struct LinkNode {
typedef struct {
LinkNode *front, *rear;
} LinkQueue;
/**定义模块**/
/**实现模块**/
void InitQueue(LinkQueue &Q) {
Q.front = Q.rear = NULL;
//不带头点初始化时front 、rear 指向NULL
@@ -68,7 +73,9 @@ bool GetHead(LinkQueue Q, int &x) {
bool QueueEmpty(LinkQueue Q) {
return Q.front == Q.rear ? true : false;
}
/**实现模块**/
/**测试模块**/
void PrintQueue(LinkQueue Q) {
printf("开始打印队列\n");
int i = 0;
@@ -119,6 +126,7 @@ void TestLinkQueue() {
printf("测试结束!\n");
}
/**测试模块**/
int main() {
TestLinkQueue();