摘要: /* 用递归和for循环来实际1-100之种 */ include<stdio.h> int f(int n, int i) { --i; if(i == 1) { n = n + 1; return n; } n = n + i; f(n, i); }; int main(void) { int 阅读全文
posted @ 2020-10-28 20:33 星空0125 阅读(337) 评论(0) 推荐(0)
摘要: include<stdio.h> include<malloc.h> typedef struct BTNode { char data; struct BTNode * LChild; struct BTNode * RChild; }BTNODE, * PBTNODE; PBTNODE Crea 阅读全文
posted @ 2020-10-27 21:25 星空0125 阅读(67) 评论(0) 推荐(0)
摘要: include <stdio.h> include <malloc.h> typedef struct BTNode { char RootNode;//存放节点 struct BTNode * pLTree;//左子树 struct BTNode * pRTree;//右子树 }BTNODE, * 阅读全文
posted @ 2020-09-29 21:02 星空0125 阅读(113) 评论(0) 推荐(0)
摘要: /* 冒泡排序,从小到大 */ include<stdio.h> int main(void) { int i; int t; int p; int val; int a[6]; for(i = 0; i < 6; ++i) { printf("请输入第%d个元素的值为:", i+1); scanf 阅读全文
posted @ 2020-08-27 23:00 星空0125 阅读(169) 评论(0) 推荐(0)
摘要: 数据结构概述(教材选用严蔚敏、吴伟民,该书程序是伪算法 具体的程序是高一凡,西电的,大牛,只有 程序。还有一本书,台湾的黄国瑜自己写的 只有思路,程序是另外一个合作的清华的写 的,可惜很多错的。) 学完数据结构之后会对面向过程的函数有一个更深的了解 定义 我们如何把现实中大量而复杂的问题以特定的数据 阅读全文
posted @ 2020-08-27 22:18 星空0125 阅读(221) 评论(0) 推荐(0)
摘要: include<stdio.h> include<malloc.h> typedef struct BTNode { char data;//存放节点 struct BTNode * pLchild;//左子树 struct BTNode * pRchild;//右子树 }BTNODE, * PBT 阅读全文
posted @ 2020-08-27 22:16 星空0125 阅读(168) 评论(0) 推荐(0)
摘要: include<stdio.h> f(int n) { if(1 == n) return 1; else return n * f(n-1); } int main(void) { int i; i = f(8); printf("8的阶乘:%d\n ", i); return 0; } 阅读全文
posted @ 2020-08-23 20:16 星空0125 阅读(209) 评论(0) 推荐(0)
摘要: include<stdio.h> f(int n) { if(1 == n) return 1; else return n + f(n-1); } int main(void) { int i; i = f(100); printf("1到100之和为:%d\n ", i); return 0; 阅读全文
posted @ 2020-08-23 20:13 星空0125 阅读(1487) 评论(0) 推荐(0)
摘要: include<stdio.h> include<malloc.h> typedef struct Queue { int * pBase; int front; int rear; }QUEUE,*PQUEUE; void init_queue(PQUEUE);//初始化 bool en_queu 阅读全文
posted @ 2020-08-23 17:18 星空0125 阅读(107) 评论(0) 推荐(0)
摘要: include<stdio.h> include<malloc.h> include<stdlib.h> typedef struct Node { int data; struct Node * pNext; }NODE, * PNODE; typedef struct Stack { PNODE 阅读全文
posted @ 2020-08-23 15:29 星空0125 阅读(119) 评论(0) 推荐(0)