自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(13)
  • 资源 (1)
  • 收藏
  • 关注

原创 二叉排序树

#include<stdio.h>#include<stdlib.h>typedef struct Node{ int val; struct Node *lchild, *rchild;}Node, *Bptr;int temp;void CreatB(Bptr *p){ *p = (Node*)malloc(sizeof(Node)); (**p)....

2020-02-21 15:44:37 191 1

原创 线索二叉树(中序线索化,非递归遍历)

#include<stdio.h>#include<stdlib.h>typedef char Type;typedef struct Node{ Type val; struct Node *lchild, *rchild; int ltag, rtag;//0-thread, 1-link}Node, *Bptr;Bptr pre; void I...

2020-02-20 22:04:21 1480

原创 哈希查找(开放定址法线性探测消解冲突)

#include<stdio.h>#include<stdlib.h>#define HASH_SIZE 12#define NULL_DATA -99typedef struct{ int *base;//元素存储首址 int count;//元素个数 }HashTable;void Init(HashTable *h){ h->count ...

2020-02-17 12:07:11 347

原创 二叉树创建过程答疑(指针参数传递与无法退出递归问题答疑)

如果您觉得有用请点赞二叉树创建为什么要传指针的指针报错的代码void CreatB(Node *p){ Type c; scanf("%c", &c); if(c == '#'){ p = NULL; } else{ p = (Bptr)malloc(sizeof(Node)); printf("p is %p\n", p); if(!p){ ex...

2020-02-15 22:23:17 1032 1

原创 背包问题(递归回溯法)

#include<stdio.h>int sum;//int i;//包裹的序号 int a[11] = {6,7,2,5,1,9,12,25,1,4};int no[11];int p = 0;int base = 0;int top = -1;void P(int n, int s, int i){ int j; sum = sum + a[i]; no...

2020-02-12 19:13:53 363

原创 倒序输出字符串(递归)

#include<stdio.h>#include<stdlib.h>void print(){ char c; scanf("%c", &c); if(c == '#'){ return; }else print(); printf("%c", c);}int main(){ print(); return 0;}递归法只需要控制...

2020-02-11 09:40:07 571

原创 折半查找(递归)

#include<stdio.h>#include<stdlib.h>typedef int Type;Type Sear(Type *low, Type *high, Type aim, Type *base){ Type *mid = low + (high - low)/2; if(aim < *mid){ high = mid; mid ...

2020-02-11 09:20:06 193

原创 八皇后问题(递归回溯)

#include<stdio.h>#include<stdlib.h>int sum = 0;int Danger(int r,int c, int(*a)[8]) { for(int i=0;i<8;i++) { if(a[i][c]) return 0; } for(int i=r,j=c;i>=...

2020-02-11 09:17:25 271

原创 循环队列(顺序表)

#include<stdio.h>#include<stdlib.h>#define Size 10typedef int Type;typedef struct Que{ Type *base; int front; int rear;}Que;void Init(Que *q){ q->base = (Type*)malloc(Size * ...

2020-02-07 10:49:47 358

原创 中缀表达式转后缀表达式

#include<stdio.h>#include<math.h>#include<stdlib.h>typedef char Type;typedef struct{ Type *top;//顶指针 Type *base; //基指针 int size;//容量 }Stack;Stack stack;//stack1->siz...

2020-02-05 12:47:24 139

原创 逆波兰计算器(直接输入后缀表达式)

#include<stdio.h>#include<math.h>#include<stdlib.h>typedef float Type;typedef struct{ Type *top;//顶指针 Type *base; //基指针 int size;//容量 }Stack;Stack stack;//stack1->si...

2020-02-04 10:45:45 251

原创 堆栈实现进制转换(二进制转八进制)

#include<stdio.h>#include<math.h>#include<stdlib.h>typedef struct{ char *top;//顶指针 char *base; //基指针 int size;//容量 }Stack;Stack stack1;Stack stack2;//stack1->size = ...

2020-02-03 14:20:43 347

原创 堆栈实现进制转换(二进制转十进制)

#include<stdio.h>#include<math.h>#include<stdlib.h>#define SIZE 7 typedef struct{ int key;//数值 int i;//阶数 } Stack;Stack stack[100];Stack *base = stack;Stack *top = stack ...

2020-02-02 12:50:23 660

背包问题(递归回溯).c

背包问题(递归回溯法),规定背包的目标重量,输出所有方案,输出格式是符号要求的所有物品序号与物品重量

2020-02-13

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除