自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(57)
  • 资源 (3)
  • 收藏
  • 关注

原创 fopen、fgetc、fputc用法

fopen、fgetc、fputc用法#include <stdio.h>#include <stdlib.h>//块设备: 磁盘,光驱:一次传输多个字节//字符设备: 键盘,鼠标:一次只可以传输一个字节//fp是全缓冲,3种情况//缓冲区满,fclose(),自己主动刷新//int argc后面数组的个数,char* argv[]字符数组int main(int argc,char* argv[]){ //定义文件指针,指向的是结构体,指向的空间在内核, //

2020-05-26 15:41:58 483

原创 二分查找或折半查找

二分查找或折半查找:#include <stdio.h>#include <stdlib.h>int mybsearch(int *a,int low,int high,int target){ int mid; while(low<=high) { mid=(low+high)/2; //目标值和中间值比较 if(a[mid]>target) { high=mid-1; }else if(a[mid]<target)

2020-05-25 18:25:44 141

原创 qsort给结构体或指针数组快速排序

qsort给结构体或指针数组快速排序#include <stdio.h>#include <stdlib.h>#define N 3typedef struct { int num; char name[20]; float s1; float s2; float s3;}stu,*pstu;//compare1()方法比较的是结构体int compare1(const void *pleft,const void *pright){ //一定

2020-05-25 16:08:16 1833

原创 堆排序实现

堆排序实现:func.h#include <stdio.h>#include <stdlib.h>#include <time.h>#define N 10//用宏的方法写一个交换方法#define SWAP(a,b) {int tmp;tmp=a;a=b;b=tmp;}void print(int*);void arr_heap(int*);func.c#include "func.h"//打印函数实现void print(int *a)

2020-05-24 12:36:17 267

原创 快速排序

快速排序:func.h#include <stdio.h>#include <stdlib.h>#include <time.h>#define N 10//用宏的方法写一个交换方法#define SWAP(a,b) {int tmp;tmp=a;a=b;b=tmp;}void print(int*);void arr_quick(int*,int,int);int compare(const void *,const void *);func.c

2020-05-22 20:03:10 275

原创 插入排序

插入排序:func.h#include <stdio.h>#include <stdlib.h>#include <time.h>#define N 10//用宏的方法写一个交换方法#define SWAP(a,b) {int tmp;tmp=a;a=b;b=tmp;}void print(int*);void arr_insert(int*);func.c#include "func.h"//打印函数实现void print(int *a)

2020-05-22 18:28:10 371

原创 选择排序

选择排序:func.h#include <stdio.h>#include <stdlib.h>#include <time.h>#define N 10//用宏的方法写一个交换方法#define SWAP(a,b) {int tmp;tmp=a;a=b;b=tmp;}void print(int*);void arr_select(int*);func.c#include "func.h"//打印函数实现void print(int *a)

2020-05-22 17:06:15 111

原创 常见八大排序算法时间空间稳定复杂统计

常见八大排序算法时间空间稳定复杂统计排序算法常见八种:冒泡,选择,插入,希尔,快排,堆排,归并,基排排序算法分类:插入类:插入排序,希尔排序选择类:选择排序,堆排序交换类: 冒泡排序,快速排序归并类: 归并排序分配类: 基数排序(计数排序,桶排序),通过额外空间来分配和收集来实现排序,时间复杂度可以达到线性阶,即O(n)平均时间复杂度:排序方式平均时间复杂度插入排序O(n^2)希尔排序O(n^1.3)冒泡排序O(n^2)快速排序O(nlo

2020-05-22 16:20:38 236

原创 二叉树的前序中序后序遍历

二叉树的前序中序后序遍历:#include <stdio.h>#include <stdlib.h>#define N 10//定义二叉树结构体nodetypedef struct node{ char c; struct node *pleft; struct node *pright;}Node,*pNode;typedef struct width{ pNode now; struct width *pNext;}Width,*

2020-05-22 15:56:10 149

原创 算法的时间复杂度和空间复杂度

算法的时间复杂度和空间复杂度时间复杂度:O(n)时间复杂度常用O符号来表述,不包括该函数的低阶项和首项系数。算法的时间复杂度实际表述的是最大执行次数空间复杂度:T(n)空间复杂度常用T符号来表述,衡量一个算法临时占用存储空间大小的...

2020-05-22 14:52:53 83

原创 二叉树新建

二叉树新建:#include <stdio.h>#include <stdlib.h>#define N 10//定义二叉树结构体nodetypedef struct node{ char c; struct node *pleft; struct node *pright;}Node,*pNode;//外层控制进树的元素,内层循环帮忙找到树中的位置int main(){ char c[N+1] ="ABCDEFGHIJ"; //定义结构

2020-05-22 12:42:53 173

原创 栈的入栈出栈返回栈顶元素元素个数判空

栈的入栈出栈返回栈顶元素元素个数判空#include <stdio.h>#include <stdlib.h>#include <string.h>//定义节点typedef struct tag{ int val; struct tag *pNext;}Node,*pNode;//别名//定义栈typedef struct{ //头指针 pNode phead; //栈中的元素个数 int size;}Stack,*pStack;

2020-05-22 09:07:31 1702

原创 什么是枚举enum

什么是枚举enum枚举:将变量的值一一列举出来,变量的值只限于列举出来的值的范围#include <stdio.h>#include <stdlib.h>//枚举类型 这里面的每一个叫枚举常量,变量必须是其中之一//c默认枚举从0开始,枚举元素按常量处理,不是变量//设置sun=1,则其后依次1上自增++,thu=7即fri=8,sat=9enum weekday{sun=1,mon,tue,wed,thu=7,fri,sat};int main(){ //枚

2020-05-19 21:53:28 216

原创 什么是共用体union

什么是共用体union定义共用体变量方法,例如union data//data为共用体名{ int i; char ch; float f;}a,b,c;或者union data//data为共用体名{ int i; char ch; float f;};union data a,b,c;联合体:#include <stdio.h>#include <stdlib.h>union MyUnion{ int a; float

2020-05-19 21:40:37 480

原创 链表的修改

链表的修改func.h#include <stdio.h>#include <stdlib.h>#include <string.h>typedef struct student{ int num; float score; //新来的学生 struct student *pNext;}stu,*pstu;void list_sort_insert(pstu *,pstu *,int);void list_modify(pstu,i

2020-05-19 21:13:51 1623

原创 链表之删除某个值的结点

链表之删除某个值的结点func.h#include <stdio.h>#include <stdlib.h>#include <string.h>typedef struct student{ int num; //新来的学生 struct student *pNext;}stu,*pstu;void list_sort_insert(pstu *,pstu *,int);void list_delete(pstu *,pstu *,in

2020-05-19 20:53:10 221

原创 链表的有序插入法创建

链表的有序插入法创建func.h#include <stdio.h>#include <stdlib.h>#include <string.h>typedef struct student{ int num; //新来的学生 struct student *pNext;}stu,*pstu;void list_sort_insert(pstu *,pstu *,int);void list_print(pstu);func.c#i

2020-05-19 00:09:22 618

原创 链表的尾插法创建

链表的尾插法创建func.h:#include <stdio.h>#include <stdlib.h>#include <string.h>typedef struct student{ int num; //新来的学生 struct student *pNext;}stu,*pstu;void list_tail_insert(pstu *,pstu *,int);void list_print(pstu);func.c:#in

2020-05-18 23:12:32 211

原创 链表的头插法创建

链表的头插法创建头文件:func.h#include <stdio.h>#include <stdlib.h>#include <string.h>typedef struct student{ int num; //新来的学生 struct student *pNext;}stu,*pstu;//为什么函数声明放到头文件中//不同文件调用都会引用头文件void list_head_insert(pstu *,pstu *,int);

2020-05-17 23:36:51 307

原创 链表是什么

什么是链表:链表是一种常见的数据结构,是动态进行存储分配的结构。头指针放一个地址,该地址指向一个元素节点:用户需要的实际数据和链接节点,可不断增加节点,最后一个节点内的指针存储为NULL,用于判断到达链表尾。...

2020-05-15 19:39:47 165

原创 什么是typedef

什么是typedef每次都写struct student s,觉得有点长,怎么解决?答案:可以用typedef声明新的类型来代替已有的类型名。#include <stdio.h>#include <stdlib.h>#define N 5//define 无分号 typedef 有分号;typedef int INTERGE; typedef struct student{ int num; char name[20]; char sex;}stu

2020-05-15 17:52:51 336

原创 结构体指针

结构体指针网上有种错误说法,二级指针是指针的指针,这是错误的准确说二级指针是指针变量的指针可以设置一个指针变量,用来指向一个结构体变量,此时该指针变量的值是结构体变量的起始地址。指针变量也可以用来指向结构体数组中的元素。#include <stdio.h>#include <stdlib.h>struct student{ int num; char name[20]; char sex;};int main(){ //定义 struct st

2020-05-15 16:30:12 112

原创 结构体定义

结构体定义:struct 结构体名{成员类型 变量名;}#include <stdio.h>#include <stdlib.h>struct student{ int num; char name[20]; char sex; int age; float score; char addr[30];};//定义一个结构体类型,最后必须要加分号int main(){ //字符数组用"",字符用'' //结构体占多大空间? //结构体大

2020-05-15 15:44:59 241

原创 静态局部变量和动态局部变量区别

静态局部变量和动态局部变量区别:1.静态局部变量属于静态存储类别,在静态存储区分配存储单元,在整个运行期间都不释放。而自动变量(动态局部变量)属于动态存储类别,占动态存储空间,函数调用后释放2.静态局部变量在编译时赋初值,程序运次时已经有初值,以后每次调用函数不再重新赋初值而只是保留上次函数调用结束时的值。3.静态局部变量编译时赋初值默认是0而自动变量,如果不赋初值则它的值是不确定的值。4.静态局部变量在函数调用结束后仍然存在,但其他函数不能引用它。如果用static修饰全局变量,那么该全局变

2020-05-13 10:03:05 6014

原创 变量值存在时间角度划分之动态存储和静态存储

变量存在时间角度划分之动态存储和静态存储: 变量和函数有两个属性:数据类型和数据存储类别(静态或动态存储方式)静态存储方式:程序运行期间由系统分配固定存储空间的方式静态的static修饰:局部变量或全局变量#include "func.h"//可以用extern来提升作用范围//可用extern在别的文件来借用全局变量extern int i;void print(){ //当用static修饰时,t就不存在栈空间,栈空间执行完会释放 //static 静态变量会放到数据段的静

2020-05-13 09:54:09 950

原创 变量作用域划分:局部变量和全局变量

局部变量和全局变量局部变量即内部变量:1.只在本函数内有效2.主函数中定义变量只在主函数中有效,而不是在整个文件内有效。主函数也不能使用其他函数定义的变量。3.形式参数也是局部变量。4.复合语句(比如有大括号)中定义的变量只在本复合语句中有效,这种符合语句称为程序块,如int j=55.不同函数内局部变量可以重名全局变量即外部变量:1.可以为本文件中其他函数所共用2.有效范围从定义变量的位置开始到本源文件结束3.全局变量在程序的全部执行过程中都占用存储单元,而不是需要时才开辟单元。4

2020-05-13 09:28:57 2059

原创 递归调用之汉诺塔

递归调用之汉诺塔:#include <stdio.h>#include <stdlib.h>void move(char x,char y){ printf("%c-->%c\n",x,y);}void hanoi(int m,char one,char two,char three){ if(1==m){ move(one,three); }else{ //中间一定有个阶段,借助three,n-1个盘子都放到two上 hanoi(m-

2020-05-13 09:02:12 168

原创 函数递归调用:上1个或2个台阶或斐波那契数列

函数递归调用:上1个或2个台阶或斐波那契数列#include <stdio.h>#include <stdlib.h>//递归调用:函数自身调用自身//n个台阶,一次上1个或2个台阶,有几种走法?int f(int n){ //1.找出公式 //2.必须写结束条件,不写会栈溢出 //栈溢出:1.某个函数空间超出(main函数只有1M) // 2.总的函数调用次数有上限 if(1==n)//必须有结束条件 { return 1; }

2020-05-13 08:38:08 219

原创 递归调用之n的阶乘

函数递归调用:求从1到n的阶乘:#include <stdio.h>#include <stdlib.h>//递归调用:函数自身调用自身int f(int n){ //1.找出公式 //2.必须写结束条件,不写会栈溢出 //栈溢出:1.某个函数空间超出(main函数只有1M) // 2.总的函数调用次数有上限 if(1==n)//必须有结束条件 { return 1; } return n*f(n-1);}int m

2020-05-13 00:23:10 1011

原创 函数形参与实参注意事项

函数形参与实参注意事项:1.未进行函数调用时,形参并不占内存存储单元。只有调用函数,形参才被分配内存,调用结束形参内存单元被释放。2.实参可以是常量、变量或表达式,但要求有确定值。使用print(i,i++);,是不合适的,因为C标准没有规定函数调用从左到右还是从右到左。不用在传参用++、–、=运算符3.多个参数逗号隔开4.实参与形参个数和类型匹配,顺序一一对应。5.值传递:只能实参传给形参,不能形参传给实参,用指针可以改变值。...

2020-05-13 00:07:30 1096

原创 函数间传递数据使用的方法

函数间传递数据使用的方法1.参数:通过形参和实参2.返回值:用return语句返回结果3.全局变量:外部变量全局变量:#include "func.h"//如果使用双引号,优先搜索当前目录是否有该头文件"func.h"//要求和.c在同一个目录//全局变量i 在不同的函数间都可以使用,一旦执行一直占用空间,尽量少用//全局变量又叫外部变量,从定义位置开始到结尾有效,不是全部范围//局部变量i 只能在各自的函数内使用int i=10;void print(int i){ pr

2020-05-12 23:54:55 773

原创 函数的分类

函数的分类1.标准函数即库函数,由系统提供,用户不必自己定义,直接使用,头文件有这些函数声明2.用户自己定义的函数

2020-05-12 23:34:56 209

原创 分别编译

分别编译头文件:#include <stdio.h>#include <stdlib.h>编译两个原文件:func.c和main.cfunc,c:#include "func.h"//函数的定义就是函数的实现int sum(int a,int b){ printf("sum=%d\n",a+b); return a+b;}main.c:#include "func.h"//如果使用双引号,优先搜索当前目录是否有该头文件"func.h"//要

2020-05-12 23:27:05 249

原创 函数嵌套调用

函数嵌套调用返回值return 只能传出一个参数一般用指针,可以多个,指针称为传入传出参数#include <stdio.h>#include <stdlib.h>#include <setjmp.h>//导入头文件,设置全局变量//用来保存进程执行的上下文jmp_buf envbuf;//j 形参 :值传递,j位置和i不同int printstar(int j){ printf("*******\n"); //理解携程编程第一步: //不回

2020-05-12 22:07:53 207

原创 找出现一次的2个数

102个数找各出现一次的2个数#include <stdio.h>#include <stdlib.h>#define N 8int main(){ //int数组a[8] int a[N]={1,1,2,2,3,3,12,5}; //定义两个数组b[N]和c[N] int b[N]; int c[N]; int i,j,k; int res=0; //分割 int split; for(i=0;i<N;i++){ res=res^a[

2020-05-12 18:57:57 78

原创 字符串翻转

字符串翻转#include <stdio.h>#include <stdlib.h>#include <string.h>//两个指针,一个指头,一个指尾void reserve(char *start,char*end){ //翻转字符串 char c; //当start<end时,进行循环 while(start<end){ //交换,值传递 c=*start; *start=*end; *end=c

2020-05-12 18:19:03 114

原创 柱状图作业

柱状图作业键盘输入字符,将字母、数字和其他字符统计并以柱状图打印#include <stdio.h>#include <stdlib.h>int main(){ //定义字符c char c; //定义short类型alp,num,oth; int alp,num,oth; // 定义int型big,mid,small int big,mid,small; //定义int i int i; //初始化alp,num,oth均为0 alp=

2020-05-12 17:35:21 335

原创 函数指针

函数指针:定义函数指针p,将函数b赋值给p,为什么可以赋值呢,其实是因为函数名本身存储的即为函数入口地址,将p传递给函数a,相当于把一个行为传递给函数a。#include <stdio.h>#include <stdlib.h>void b(){ printf("I am func b\n");}void c(){ printf("I am func ...

2020-05-07 15:25:17 104

原创 冒泡排序

C语言冒泡排序:#include <stdio.h>#include <stdlib.h>#include <string.h>//冒泡法排序:相邻两个两两比较int main(){ //定义字符指针数组p大小为5 char *p[5]; //定义字符指针t char *t; //定义二级字符指针p2 char **p2; //声明in...

2020-05-07 14:28:54 104

原创 二级指针的偏移

二级指针的偏移假如让每个指针指向商品信息,排序比较时,我们比较实际商品信息,但交换的是指针,这样交换成本极大降低,这种思想称为索引式排序。*指针数组:存储了多个指针的数组 char * p[5];sizeof§为5sizeof(char)=20数组指针:指向一维数组的指针, char (p)[5];sizeof§为4#include <stdio.h>#includ...

2020-05-07 13:18:14 580

mysql脚本文件init.sql

mysql脚本文件init.sql

2022-04-25

逆向工程生成entity,mapper,mapper.xml

逆向工程生成entity,mapper,mapper.xml

2020-08-17

jdk-1.8-adbycool.zip

JDK1.8 Window 系统64位 Java Development Kit (JDK) 是Sun公司(已被Oracle收购)针对Java开发员的软件开发工具包。自从Java推出以来,JDK已经成为使用最广泛的Java SDK(Software development kit)。 在线JDK6文档: 中文 英文 在线JDK7文档: 英文 SE(J2SE),standard edition,标准版,是我们通常用的一个版本,从JDK 5.0开始,改名为Java SE。 EE(J2EE),enterprise edition,企业版,使用这种JDK开发J2EE应用程序,从JDK 5.0开始,改名为Java EE。 ME(J2ME),micro edition,主要用于移动设备、嵌入式设备上的java应用程序,从JDK 5.0开始,改名为Java ME。 没有JDK的话,无法编译Java程序,如果想只运行Java程序,要确保已安装相应的JRE。

2020-08-15

空空如也

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

TA关注的人

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