
C语言
美好环环相扣
困难都只是暂时的,冲鸭!
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
操作系统动态页面分配算法
写的一个小样例,有空再优化*//利用c语言模拟动态内存分配// 主要分配算法: 首次适应算法 最佳适应算法#include <stdio.h>#include <string.h>#include <time.h>#include <stdlib.h>#define Max 5// 表示分配的最大内存空间//表示空闲区内存单元大小s...原创 2020-05-01 16:01:08 · 388 阅读 · 0 评论 -
C语言邻接表各种操作
代码#include <stdio.h>#include <malloc.h>#define MVNum 100 //最大的顶点数typedef int VerTexType;typedef struct ArcNode {//定义边节点 int adjves;//该边所指向的顶点的位置 struct ArcNode * nextarc;//指向...原创 2020-02-05 18:07:50 · 574 阅读 · 0 评论 -
C语言邻接矩阵各种操作
#include <stdio.h>#include <malloc.h>#define MAxINt 32767 //表示极大值#define MVNUm 10 //顶点的个数int visited[10];typedef char VerTexType; //顶点的数据类型为字符型typedef int ArcType; // 假设边的权值类型为整型t...原创 2020-02-05 18:06:11 · 785 阅读 · 0 评论 -
LeetCode100
题目给定两个二叉树,编写一个函数来检验它们是否相同。如果两个树在结构上相同,并且节点具有相同的值,则认为它们是相同的。示例 1:输入: 1 1/ \ / 2 3 2 3 [1,2,3], [1,2,3]输出: true示例 2:输入: 1 1/ 2 ...原创 2020-02-04 21:06:19 · 145 阅读 · 0 评论 -
C语言二叉树各种操作
代码#include <stdio.h>#include <malloc.h>typedef struct BiTree { // 定义二叉树的结构体 int data;//定义二叉树的数据类型 struct BiTree *lchild, *rchild;//递归定义二叉树的左子树 右子树} BiTNode, *BiTree;int Cr...原创 2020-02-03 15:45:42 · 1298 阅读 · 3 评论 -
c语言链栈的各种操作
链栈的实现和单链表一样,只是存取的位置不一样。参考文章传送门原创 2020-01-29 16:27:18 · 227 阅读 · 0 评论 -
c语言链队列的各种操作
连队列和单链表差不多,只是存取位置限定。参考同类博文c语言单链表即可传送门原创 2020-01-29 16:22:57 · 257 阅读 · 0 评论 -
c语言顺序栈的各种操作
代码#include <stdio.h>#include <malloc.h>typedef struct { int *base;//基地址 int font;//头指针 int bear;//尾指针}SqQueen;#define MAX 10 //循环顺序队列void initQueen(SqQueen *q){//循环队列的...原创 2020-01-29 16:18:35 · 345 阅读 · 0 评论 -
c语言栈的各种操作
武汉加油!!栈的各种操作#include <stdio.h>#include <malloc.h>#include <string.h>#define MAX 10//栈的大小#define INCSIZE 10 //栈满时增加内存 relloc函数typedef struct { //定义顺序栈 int * base;//栈底指针 ...原创 2020-01-28 22:30:59 · 818 阅读 · 0 评论 -
leetcode21
将两个有序链表合并为一个新的有序链表并返回。新链表是通过拼接给定的两个链表的所有节点组成的。示例:输入:1->2->4, 1->3->4输出:1->1->2->3->4->4来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/merge-two-sorted-lists著作权归领扣网...原创 2020-01-27 17:29:57 · 378 阅读 · 0 评论 -
C语言链表各种操作
今天是大年初二,由于阿冠影响,继续学习#include <stdio.h>#include <malloc.h>typedef struct { int age; char name[10];}Element;typedef struct Node{ //单链表实现 Element data;//注意区别顺序表 struct...原创 2020-01-26 17:13:07 · 368 阅读 · 0 评论 -
C语言实现顺序表的各种操作
在因为阿冠得家哪儿都不能去,就把数据结构和算法复习复习顺序表得各种操作#include <stdio.h>#include <malloc.h>#define MAXSIZE 10typedef struct { // 存放数据的结构体 int age; char name[20];}student;typedef struct { ...原创 2020-01-25 22:03:38 · 478 阅读 · 0 评论