摘要: 接收信息分字符流和字节流 字节流: byte[] buffer = new byte[1024]; //字节数组buffer InputStream inputStream = socket.getInputStream();//获取字节流 int len = inputStream.read(bu 阅读全文
posted @ 2021-02-01 12:08 倔强的不死人 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 转载:https://blog.csdn.net/n_fly/article/details/100807778 阅读全文
posted @ 2021-01-27 15:21 倔强的不死人 阅读(372) 评论(0) 推荐(0) 编辑
摘要: void copy(BiTree T,BiTree &NewT){ //复制树 if(T == NULL){ NewT = NULL; return; }else { NewT = new BiTNode; NewT->data = T->data; copy(T->lchild,NewT->lch 阅读全文
posted @ 2020-11-24 22:13 倔强的不死人 阅读(273) 评论(0) 推荐(0) 编辑
摘要: static int w =0; //统计每层节点个数,从而找出最大层数 static int Wid[10]={0}; void Width(BiTree T){ if(T == NULL) return; else { w++; Wid[w]++; Width(T->lchild); if(T- 阅读全文
posted @ 2020-11-24 22:10 倔强的不死人 阅读(1163) 评论(0) 推荐(0) 编辑
摘要: 通过队列就可以方便的将同一层的节点连续地存放在一起 static LinkQueue Q ; //定义一个队列 void levelTraverse(BiTree T){ BiTree e; if(T){ EnQueue(Q,T); //入队列 while(Q.front != Q.rear){ D 阅读全文
posted @ 2020-11-24 21:31 倔强的不死人 阅读(752) 评论(0) 推荐(0) 编辑
摘要: //"LinkStack.h" #include<iostream> using namespace std; #define LElemType BiTree #define MAXSIZE 100 typedef struct BiTNode{ char data; struct BiTNode 阅读全文
posted @ 2020-11-23 15:31 倔强的不死人 阅读(177) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include <cstring> #include <fstream> using namespace std; #define MAXLEN 255 /* n个整数存放在数组中,将正数排在负数前,时间复杂度为O(n) */ void change(int 阅读全文
posted @ 2020-11-22 16:27 倔强的不死人 阅读(296) 评论(0) 推荐(0) 编辑
摘要: 1.从输入到存储时就改变存储的顺序 void InvertStore(char a[]){ char ch; static int i = 0; cin >> ch; if(ch != '.'){ InvertStore(a); a[i++] = ch; } a[i] = '\0'; //结束符 } 阅读全文
posted @ 2020-11-22 15:00 倔强的不死人 阅读(359) 评论(0) 推荐(0) 编辑
摘要: 对nextval的实现还暂时停留在会算的地步上 No 1 2 3 4 5 6 7 8 9 10 11 12 13 14 a b a c b a a a b c a b a a next 0 1 1 2 1 1 2 2 2 3 1 2 3 4 nextval 0 1 0 2 1 0 2 2 1 3 0 阅读全文
posted @ 2020-11-21 21:19 倔强的不死人 阅读(310) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include <cstring> #include <fstream> using namespace std; #define MAXLEN 20 /* 病毒检测,BF算法,匹配子串 */ typedef struct{ char ch[MAXLEN+1] 阅读全文
posted @ 2020-11-21 20:18 倔强的不死人 阅读(351) 评论(0) 推荐(0) 编辑