- 博客(26)
- 收藏
- 关注
原创 顺序表的各项操作
sqlist.h#ifndef SQLIST_H#define SQLIST_H#define SUCCESS 10000#define FAILURE 10001#define TRUE 10002#define FALSE 10003#define SIZE 10typedef int ElemType;struct sq...
2019-07-24 17:55:50
279
原创 进程间通信
学习内容:一、进程间通信方式1、有名管道(FIFO)和管道(PIPO)。管道:(1)单向,先进先出,把一个进程的输入和输出连接在一起。 (2)在管道的尾部写入程序,在管道的头部读出数据。 (3)数据被一个进程读取后,将从管道删除。 (4)进程阻塞情况:读空管道时,或者进程已经写满。、*(无名)管道:父进程和子进...
2018-08-19 14:38:25
256
原创 进程
学习内容:一、一些定义1、进程:资源分配的最小单元(动态的,暂时的),包括程序、数据和进程控制块。 程序:放到磁盘的可执行文件(静态的,长久的)。***一个程序可对应多个进程,通过调用关系,一个进程可包括多个程序。2、进程的三个状态:执行状态、就绪状态、等待状态。(一般我们看到的就是程序正在运行)。3、进程ID:PID(标识进程的唯一数字)。 父进程的...
2018-08-15 20:35:08
251
原创 链表通讯录文件读取保存
实现信息的存储 #ifndef _LINKLIST_H#define _LINKLIST_H#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/types.h>#include <sys/stat.h>#include <fc...
2018-08-14 19:54:22
1028
原创 结构体文件保存
#include <stdio.h>#include <string.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <stdlib.h>struct Student{ char name[20]; ...
2018-08-13 19:58:31
542
原创 数据结构8大排序
直接插入排序:#include <stdio.h>void InsertSort(int b[],int size){ int i,j; int temp = 0; for(i = 0; i < size; i++) { int temp = b[i]; for(j = i - 1; j >= 0; ...
2018-08-13 19:37:19
176
原创 二叉树的先中后序遍历
#include <stdio.h>#include <stdlib.h>struct node{ int data; struct node *right,*left;};typedef struct node TreeNode;TreeNode *CreatTree(int *a){ int i; TreeN...
2018-08-13 19:29:04
167
原创 链队列的各种基本操作及注意点分析
头文件 #ifndef _LINKQUEUE_H#define _LINKQUEUE_H#define SUCCESS 10000#define FAILURE 10001#define TRUE 10002#define FALSE 10003struct node{ int data; struct node *next;};...
2018-08-10 21:11:46
1987
原创 队列实现杨辉三角
使用队列实现杨辉三角,主要思想:建立两个空队列,先往第一个空队列中输入0 1 0,本来第一行为1,给它的左右各补一个0,之后每行的左右都加一个0。第一个队列先删除0,有返回值 0,让其加上第一个队列现在的第一个元素后进入第二个队列,以此类推#include "SequenceQueue.h"#include <stdio.h>int InitQueue(Queue *q...
2018-08-10 20:53:05
2900
原创 运用链栈构建简易计算器 ,顺序栈和链栈的一些区别,以及链栈的初始化,进栈,出栈等各种操作
一、 简易计算器***注意点***操作数: 进栈操作数: 1、进栈:(1)进栈 (2)优先级高 (3)栈顶是‘(’,同时表达式不是‘)’ 2、出栈计算: (1)优先级不高于 (2)表达式‘)’,同时栈顶不是‘(’ (3)表达式‘\0’,同时栈不为空 ...
2018-08-08 20:58:43
608
原创 单链表头插法和尾插法的实现
#ifndef _LINKLIST_H#define _LINKLIST_H#define FAILURE 10000#define SUCCESS 10001#define TRUE 10002#define FALSE 10003typedef int ElemType; struct node{ ElemType data; ...
2018-08-07 21:14:41
2608
原创 双向链表
学习内容:头文件#ifndef _DOUBLELINKLIST_H#define _DOUBLELINKLIST_H#define FAILURE 10000#define SUCCESS 10001#define TRUE 10002#define FALSE 10003typedef int ElemType; struct no...
2018-08-06 20:33:02
117
原创 通过链表实现的简易通讯录
学习内容:链表通讯录#ifndef _LINKLIST_H#define _LINKLIST_H#include <stdio.h>#include <stdlib.h>#include <string.h>#define SIZE 1000#define FAILURE 10000#define SUCCESS 10001#...
2018-08-05 19:55:52
836
原创 单链表的初始化,插入,遍历,长度,倒序,删除等等
学习内容:单链表的初始化,插入,遍历,长度,倒序,获取元素,定位,删除清空等等。主要函数实现:#include <stdlib.h>#include "LinkList.h"int LinkInit(Node **l){ *l = (Node *)malloc(sizeof(Node)*1); if(NULL == *l) { r...
2018-08-04 21:11:50
300
原创 线性表直接插入排序
学习内容:线性表直接插入排序#include <stdio.h>#include "SequenceInsert.h"#include <stdlib.h>int SequenceInit(SqList *l){ if(NULL==l) { return FAILURE; } l->length=0; ...
2018-08-03 20:54:48
1380
原创 线性表基本功能的实现
学习内容:线性表:存储,插入,删除,求长度,遍历等等。分为3部分:头文件,函数,主函数#include "SequenceList.h"#include <stdlib.h>#include <stdio.h>int SequenceInit(SqList *l){ if(NULL==l) { return FAILURE;...
2018-08-02 20:52:49
287
原创 简易通讯录
学习内容:简易通讯录#include <stdio.h>#include <stdlib.h>#include <string.h>#define SIZE 1000int person=0;struct student{ char name[100]; int age; char sex;};typedef str...
2018-08-01 16:14:34
143
原创 编译注意点
学习内容:今天完成趣味100题中的9题,主要错误是:头文件包含#include<math.h>,编译的时候要加-lm.通讯录大概做了一大半,还有待完善。由于通讯录里面信息要按照姓名排序,所以又回顾了一下字符串冒泡排序,因为使用了结构体指针数组,所以获取字符串和输出时要注意使用-> for(i=0;i<person-1;i++) { for(...
2018-07-31 22:57:46
144
原创 求结构体的长度
学习内容: 1、趣味100题33-38,其中第35题较长,比较突出的错误就是return的位置错误,导致段错误num (int number){ int j; if(!ok(number)) { return(0); } for(j = 0; number > 0; number /= 10) { j...
2018-07-30 16:17:37
1870
原创 结构体的三种输出方式
学习内容:1、结构体通过三种方式输出#include <stdio.h>#include <string.h>#include <stdlib.h>struct student{ char name[20]; int age; char sex;};struct A{ int x; struc...
2018-07-29 20:30:01
36443
原创 atoi , atof 强制转换的应用
学习内容: #include <stdio.h>#include <string.h>#include <stdlib.h>void GetArray(char *a[], int length){ int i; printf("Please input:\n"); for (i = 0; i < length; i...
2018-07-28 21:10:38
265
原创 字符串冒泡排序
学习内容:1、使用冒泡排序法,将字符串进行排序,按照26个字母大小排序。和数字的冒泡排序类似#include <stdio.h>#include <string.h>#include <stdlib.h>void GetArray(char *a[], int length){ int i; printf("Please input:\n...
2018-07-27 20:44:19
2306
原创 宏函数和自定义函数 以及 宏函数特性
学习内容:1、预处理:#include "stdio.h"在当前目录和环境指定的目录中找到该文件。 #include <stdio.h>在由环境指定的文件目录中找到该文件2、宏#define 可以定义函数例如:#define OUT printf("helloworld\n") 无参宏函数 #...
2018-07-26 19:28:07
378
原创 指针
学习任务:今天学习了关于指针的内容。理解:所有的指针都是4字节。 一、 *的两个含义:1、定义的时候:表示后面的变量是一个指针(无取值的意思) 2、使用的时候:表示取值(*p前无 int,char等等) 二、*px++和(*px)++的区别#include <stdio...
2018-07-25 20:09:25
195
原创 strcpy ,strncpy ,strcat 的区别以及复制特点
学习任务:今天主要做了几个关于整数算法的训练1、有n个人围成一圈,顺序排号,从第一个开始报数(从1到3报数),凡报到3的人退出圈子,问最后留下的是原来的几号#include<stdio.h>int main(){ int i,k,j,n,num[50],*p;//j:删除人数 k:计数 printf("input number ...
2018-07-24 20:35:47
627
原创 数组和函数
学习内容:今天主要学习了数组和函数,了解了数组的表示方式以及数组地址的相关内容1、一维数组 :&a[0]:数组首元素地址 单位4字节 a:数组名,同时也是数组首元素地址 单位4字节 &a:数组的地址 单位是一个数组的总字节二维数组可以类比&a[0][0]:首元素地址 单位4字节a[0]:首行首元素地址单位4字节...
2018-07-23 20:50:59
200
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人