算法
不秃头也能变强
二把刀程序员
展开
-
王道数据结构 循环队列
#include <iostream>#include<stdio.h>#define MaxSize 50using namespace std;typedef struct { int front, rear; int data[MaxSize];}sqQueue;void InitQueue(sqQueue &Q) { Q.front = 0; Q.rear = 0;}bool isEmpty(sqQueue &Q) { //判空原创 2021-05-16 00:33:28 · 188 阅读 · 0 评论 -
王道数据结构 顺序队列基本操作
#include <iostream>#include<stdio.h>#define MaxSize 50using namespace std;typedef struct { int data[MaxSize]; int front, rear;}SqQueue;void InitQueue(SqQueue &Q) { //初始化 Q.front = 0; Q.rear = 0;}bool QueueEmpty(SqQueue &原创 2021-05-15 23:44:42 · 207 阅读 · 0 评论 -
王道数据结构 顺序栈基本操作
#include <iostream>#include<stdio.h>#define MaxSize 50 //定义栈中元素的最大个数using namespace std;typedef struct { int data[MaxSize]; //存放栈中的元素 int top; //栈顶指针}SqStack;void InitStack(SqStack &s) { //初始化 s.top = -1;}bool StackEmpty(SqSt原创 2021-05-15 21:17:27 · 206 阅读 · 0 评论 -
数据结构:王道+严蔚敏 顺序表基本操作
#define _CRT_SECURE_NO_WARNINGS#include <iostream>#include<stdio.h>#include<time.h>#define MaxSize 10 //定义最大长度using namespace std;typedef struct { int date[MaxSize];//用静态的“数组存放数据元素” int length; //顺序表的当前长度}SqList; //顺序表的类型定义vo原创 2021-04-05 23:16:26 · 600 阅读 · 0 评论 -
快速排序+归并排序c++带注释详解
//快速排序#define _CRT_SECURE_NO_WARNINGS#include <iostream>#include<stdio.h>#include<time.h>using namespace std;void quickSort(int a[], int left, int right) { if (left < right)//判断是否满足排序条件 { int i = left, j = right;//待排序数组的第一原创 2021-04-05 22:37:37 · 154 阅读 · 0 评论 -
棋盘覆盖c++
#define _CRT_SECURE_NO_WARNINGS#include <iostream>#include<stdio.h>using namespace std;static int tile = 1;//l型骨牌的编号static int Board[1024][1024];//棋盘最大为1024*1024void Chessboard(int tr,int tc,int dr,int dc,int size) { /* tr:当前棋盘左上角的行号原创 2021-01-17 23:55:07 · 543 阅读 · 0 评论