摘要:
/* sequenceQueue.c */ /* 顺序队列 */ #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #define MAXSIZE 100 /* 顺序循环队列数据结构 */ /* 一个圆圈,front指向队列头,rear指向队列尾 */ /* front -> ... -> rear data[0] -> dat 阅读全文
摘要:
/* recursion.c */ /* 递归 */ #include <stdio.h> void interface(void); /* 斐波那契数列以及阶乘函数声明 */ long long factorial(int n); void fibonacci(int x, int y, int stop); int main(){ int flag, number; interface(); 阅读全文
摘要:
/* linkStack.c */ /* 链栈 */ #include <stdio.h> #include <stdlib.h> #include <stdbool.h> /* 链栈数据结构 */ /* ———————————————— | value | next | < top ———————————————— ↓ ———————————————— | value | next | ———— 阅读全文
摘要:
/* sequenceStack.c */ /* 栈 先进后出(First In Last Out,FILO)*/ #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #define MAXSIZE 100 /* 栈数据结构 */ /* —————————— | data[2] | < top ——————————— | ———— 阅读全文
摘要:
/* sequenceList.c */ /* 顺序表 */ /* 线性表的顺序存储是指在内存中用地址连续的一块存储空间顺序存放线性表中的各项数据元素,用这种存储形式的线性表称为顺序表。 */ #include #include #include #define MAXSIZE 10 /* 顺序表结构 */ typedef struct { int data[MAXSIZE]... 阅读全文
摘要:
/* maxCommonFactor.c */ /* 最大公因子数 */ #include <stdio.h> int maxCommonFactor(int m, int n); int main(){ int m, n; printf("Enter two integers: "); scanf("%d %d", &m, &n); printf("max common factor: %d\n 阅读全文