摘要: #include using namespace std; const int LH=1; const int RH=-1; const int EH=0; struct BitNode { int data; int bf; BitNode *lchild,*rchild; }; void L_Rotate(BitNode *&p) { BitNode *R=p... 阅读全文
posted @ 2018-12-05 16:58 shenyuli 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 1.对象:无重复数字 2.查找代码 3.删除代码 4.实例: #include<iostream> using namespace std; struct Bts_node { int data; Bts_node *lchild,*rchild; }; bool insert_Bts(Bts_no 阅读全文
posted @ 2018-12-04 16:11 shenyuli 阅读(181) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; int binsearch(int a[],int low,int high,int k) { if(low>high) return 0; int mid=(low+high)/2; if(a[mid]==k) return mid+1; else if(a[mid]>len; ... 阅读全文
posted @ 2018-12-04 15:16 shenyuli 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 一、先序 1.方法一 2.方法二 二、中序 三、后序 四、范例 #include<iostream> #include<string> #include<stack> using namespace std; const int max_size=100; struct Btnode { char 阅读全文
posted @ 2018-11-28 19:46 shenyuli 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 一、先序 二、中序 三、后序 四、层次 五、试例 #include<iostream> #include<string> using namespace std; const int max_size=100; struct Btnode { char data; Btnode *lchild; B 阅读全文
posted @ 2018-11-27 19:38 shenyuli 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2018-11-27 16:59 shenyuli 阅读(507) 评论(0) 推荐(0) 编辑
摘要: 1.目的:当函数较短并频繁使用时,使用内联函数可以减少时间开销 2.格式 在函数定义前面加“inline”关键字,即定义了内联函数 如下: 阅读全文
posted @ 2018-11-27 16:52 shenyuli 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 一、引用 1. 引用格式 a.类型名 & 变量名 =另一个变量 b.试例: 2.常引用 二、常量 1.基本用法:const int n=12; 2.常量指针:const int *p=&n; p不可用于修改n,除此之外,p指向的对象可以再次更改 试例: 3.函数 参数指针 阅读全文
posted @ 2018-11-27 16:42 shenyuli 阅读(1031) 评论(0) 推荐(0) 编辑
摘要: 一、双亲存储结构 二、孩子链存储结构 typedef struct snode{ int data; node *next;//指向兄弟; }Son_node;typedef struct{ int data; int parent; Son_node *first_son;}Pnode;//双亲节 阅读全文
posted @ 2018-11-27 14:56 shenyuli 阅读(4560) 评论(1) 推荐(0) 编辑
摘要: 一、括号表示法建二叉树 核心代码 void make_Btree() { Btnode *st[max_size],*p; string str; int k,j=0,top=-1; b=NULL; cin>>str; for(int i=0;i<str.size();i++) { switch(s 阅读全文
posted @ 2018-11-27 14:19 shenyuli 阅读(502) 评论(0) 推荐(0) 编辑
Live2D