【海贼王的数据航海:利用数据结构成为数据海洋的霸主】链表—单链表

目录

1 -> 链表

1.1 -> 链表的概念及结构

1.2 -> 链表的分类

2 -> 无头+单向+非循环链表(单链表)

2.1 -> 接口声明

2.2 -> 接口实现

2.2.1 -> 动态申请一个结点

2.2.2 -> 单链表的打印

2.2.3 -> 单链表的尾插

2.2.4 -> 单链表的头插

2.2.5 -> 单链表的尾删

2.2.6 -> 单链表的头删

2.2.7 -> 单链表的查找

2.2.8 -> 单链表在pos位置之前插入x

2.2.9 -> 单链表在pos位置之后插入x

2.2.10 -> 单链表删除pos位置的值

2.2.11 -> 单链表删除pos位置之后的值

2.3 -> 完整代码

2.3.1 -> SList.h

2.3.2 -> SList.c

2.3.3 -> Test.c


1 -> 链表

1.1 -> 链表的概念及结构

概念:链表是一种物理存储结构上非连续、非顺序的存储结构,数据元素的逻辑顺序是通过链表中的指针链接次序实现的。

现实中 数据结构中

 注意:

  1. 上图可看出,链式结构在逻辑上是连续的,但是在物理上不一定连续;
  2. 现实中的结点一般都是从堆上申请出来的;
  3. 从堆上申请的空间,是按照一定策略分配的,两次申请的空间可能连续,也可能不连续。

假设在32位系统上,结点中值域为int类型,则一个节点的大小为8个字节,则也可能有以下链表:

1.2 -> 链表的分类

实际中链表的结构非常多样,以下情况组合起来就有八种链表结构:

1. 单向或双向

2. 带头或不带头

3. 循环或非循环

虽然有很多链表结构,但最常用的还是这两种:

1. 无头单向非循环链表

2. 带头双向循环链表

1. 无头单向非循环链表:结构简单,一般不会单独用来存储数据。实际中更多是作为其他数据结构的子结构,如哈希桶、图的邻接表等。

2. 带头双向循环链表:结构最复杂,一般用在单独存储数据。实际中使用的链表数据结构,都是带头双向循环链表。另外这个结构虽然复杂,但是使用代码实现以后会发现结构会带来很多优势,实现反而简单了。

2 -> 无头+单向+非循环链表(单链表)

2.1 -> 接口声明

#pragma once#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>// 无头+单向+非循环链表增删查改实现
typedef int SLTDateType;typedef struct SLTNode
{SLTDateType data;struct SLTNode* next;
}SLTNode;// 动态申请一个结点
SLTNode* BuySLTNode(SLTDateType x);// 单链表打印
void SLTPrint(SLTNode* phead);// 单链表尾插
void SLTPushBack(SLTNode** pphead, SLTDateType x);// 单链表的头插
void SLTPushFront(SLTNode** pphead, SLTDateType x);// 单链表的尾删
void SLTPopBack(SLTNode** pphead);// 单链表头删
void SLTPopFront(SLTNode** pphead);// 单链表查找
SLTNode* SLTFind(SLTNode* phead, SLTDateType x);// 单链表在pos位置之前插入x
void SLTInsert(SLTNode** pphead, SLTNode* pos, SLTDateType x);// 单链表在pos位置之后插入x
void SLTInsertAfter(SLTNode* pos, SLTDateType x);// 单链表删除pos位置的值
void SLTErase(SLTNode** pphead, SLTNode* pos);// 单链表删除pos位置之后的值
void SLTEraseAfter(SLTNode* pos);

2.2 -> 接口实现

2.2.1 -> 动态申请一个结点

// 动态申请一个结点
SLTNode* BuySLTNode(SLTDateType x)
{SLTNode* newnode = (SLTNode*)malloc(sizeof(SLTNode));if (newnode == NULL){perror("malloc fail");return NULL;}newnode->data = x;newnode->next = NULL;return newnode;
}

2.2.2 -> 单链表的打印

// 单链表的打印
void SLTPrint(SLTNode* phead)
{SLTNode* cur = phead;while (cur != NULL){printf("%d->", cur->data);cur = cur->next;}printf("NULL\n");
}

2.2.3 -> 单链表的尾插

// 单链表的尾插
void SLTPushBack(SLTNode** pphead, SLTDateType x)
{assert(pphead);SLTNode* newnode = BuySLTNode(x);if (*pphead == NULL){*pphead = newnode;}else{SLTNode* cur = *pphead;while (cur->next != NULL){cur = cur->next;}cur->next = newnode;}
}
// 尾插测试
void SLTTest1()
{SLTNode* plist = NULL;SLTPushBack(&plist, 1);SLTPushBack(&plist, 2);SLTPushBack(&plist, 3);SLTPushBack(&plist, 4);SLTPrint(plist);
}

2.2.4 -> 单链表的头插

// 单链表的头插
void SLTPushFront(SLTNode** pphead, SLTDateType x)
{assert(pphead);SLTNode* newnode = BuySLTNode(x);newnode->next = *pphead;*pphead = newnode;
}
// 头插测试
void SLTTest2()
{SLTNode* plist = NULL;SLTPushFront(&plist, 1);SLTPushFront(&plist, 2);SLTPushFront(&plist, 3);SLTPushFront(&plist, 4);SLTPrint(plist);
}

2.2.5 -> 单链表的尾删

// 单链表的尾删
void SLTPopBack(SLTNode** pphead)
{assert(pphead);assert(*pphead); // 暴力检查温柔的检查//if (*pphead == NULL)//{//	return;//}// 只有一个节点if ((*pphead)->next == NULL){free(*pphead);*pphead = NULL;}// 有多个节点else{SLTNode* prev = *pphead;SLTNode* tail = *pphead;while (tail->next != NULL){prev = tail;tail = tail->next;}free(tail);tail = NULL;prev->next = NULL;}
}
// 尾删测试
void SLTTest3()
{SLTNode* plist = NULL;SLTPushBack(&plist, 1);SLTPushBack(&plist, 2);SLTPushBack(&plist, 3);SLTPushBack(&plist, 4);SLTPrint(plist);SLTPopBack(&plist);SLTPrint(plist);SLTPopBack(&plist);SLTPrint(plist);SLTPopBack(&plist);SLTPrint(plist);SLTPopBack(&plist);SLTPrint(plist);
}

2.2.6 -> 单链表的头删

// 单链表的头删
void SLTPopFront(SLTNode** pphead)
{assert(*pphead);SLTNode* tail = *pphead;*pphead = (*pphead)->next;free(tail);tail = NULL;
}
// 头删测试
void SLTTest4()
{SLTNode* plist = NULL;SLTPushBack(&plist, 1);SLTPushBack(&plist, 2);SLTPushBack(&plist, 3);SLTPushBack(&plist, 4);SLTPrint(plist);SLTPopFront(&plist);SLTPrint(plist);SLTPopFront(&plist);SLTPrint(plist);SLTPopFront(&plist);SLTPrint(plist);SLTPopFront(&plist);SLTPrint(plist);
}

2.2.7 -> 单链表的查找

// 单链表的查找
SLTNode* SLTFind(SLTNode* phead, SLTDateType x)
{SLTNode* ptr = phead;while (ptr->next != NULL){if (ptr->data == x){return ptr;}else{ptr = ptr->next;}}return NULL;
}
// 查找测试
void SLTTest5()
{SLTNode* plist = NULL;SLTPushBack(&plist, 1);SLTPushBack(&plist, 2);SLTPushBack(&plist, 3);SLTPushBack(&plist, 4);SLTPrint(plist);SLTNode* ans = SLTFind(plist, 1);if (ans)ans->data = 10;SLTPrint(plist);
}

2.2.8 -> 单链表在pos位置之前插入x

// 单链表在pos位置之前插入x
void SLTInsert(SLTNode** pphead, SLTNode* pos, SLTDateType x)
{assert(pphead);assert(pos);if (pos == *pphead){SLTPushFront(pphead, x);}else{SLTNode* newnode = BuySLTNode(x);SLTNode* prev = *pphead;while (prev->next != pos){prev = prev->next;}prev->next = newnode;newnode->next = pos;}
}
// 在pos位置之前插入x测试
void SLTTest6()
{SLTNode* plist = NULL;SLTPushBack(&plist, 1);SLTPushBack(&plist, 2);SLTPushBack(&plist, 3);SLTPushBack(&plist, 4);SLTPrint(plist);SLTNode* pos = SLTFind(plist, 2);if (pos)SLTInsert(&plist, pos, 99);SLTPrint(plist);
}

2.2.9 -> 单链表在pos位置之后插入x

// 单链表在pos位置之后插入x
void SLTInsertAfter(SLTNode* pos, SLTDateType x)
{assert(pos);SLTNode* newnode = BuySLTNode(x);SLTNode* tmp = pos->next;pos->next = newnode;newnode->next = tmp;
}
// 在pos位置之后插入x测试
void SLTTest7()
{SLTNode* plist = NULL;SLTPushBack(&plist, 1);SLTPushBack(&plist, 2);SLTPushBack(&plist, 3);SLTPushBack(&plist, 4);SLTPrint(plist);SLTNode* pos = SLTFind(plist, 2);if (pos)SLTInsertAfter(pos, 99);SLTPrint(plist);
}

2.2.10 -> 单链表删除pos位置的值

// 单链表删除pos位置的值
void SLTErase(SLTNode** pphead, SLTNode* pos)
{assert(pphead);assert(*pphead);assert(pos);if (pos == *pphead){SLTPopFront(pphead);}else{SLTNode* prev = *pphead;if (prev->next != pos){prev = prev->next;}prev->next = pos->next;free(pos);pos = NULL;}
}
// 删除pos位置的值测试
void SLTTest8()
{SLTNode* plist = NULL;SLTPushBack(&plist, 1);SLTPushBack(&plist, 2);SLTPushBack(&plist, 3);SLTPushBack(&plist, 4);SLTPrint(plist);SLTNode* pos = SLTFind(plist, 2);if (pos)SLTErase(&plist, pos);SLTPrint(plist);
}

2.2.11 -> 单链表删除pos位置之后的值

// 单链表删除pos位置之后的值
void SLTEraseAfter(SLTNode* pos)
{assert(pos);assert(pos->next);SLTNode* tmp = pos->next->next;free(pos->next);pos->next = tmp;
}
// 删除pos位置之后的值测试
void SLTTest9()
{SLTNode* plist = NULL;SLTPushBack(&plist, 1);SLTPushBack(&plist, 2);SLTPushBack(&plist, 3);SLTPushBack(&plist, 4);SLTPrint(plist);SLTNode* pos = SLTFind(plist, 2);if (pos)SLTEraseAfter(pos);SLTPrint(plist);
}

2.3 -> 完整代码

2.3.1 -> SList.h

#pragma once#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>// 无头+单向+非循环链表增删查改实现
typedef int SLTDateType;typedef struct SLTNode
{SLTDateType data;struct SLTNode* next;
}SLTNode;// 动态申请一个结点
SLTNode* BuySLTNode(SLTDateType x);// 单链表打印
void SLTPrint(SLTNode* phead);// 单链表尾插
void SLTPushBack(SLTNode** pphead, SLTDateType x);// 单链表的头插
void SLTPushFront(SLTNode** pphead, SLTDateType x);// 单链表的尾删
void SLTPopBack(SLTNode** pphead);// 单链表头删
void SLTPopFront(SLTNode** pphead);// 单链表查找
SLTNode* SLTFind(SLTNode* phead, SLTDateType x);// 单链表在pos位置之前插入x
void SLTInsert(SLTNode** pphead, SLTNode* pos, SLTDateType x);// 单链表在pos位置之后插入x
void SLTInsertAfter(SLTNode* pos, SLTDateType x);// 单链表删除pos位置的值
void SLTErase(SLTNode** pphead, SLTNode* pos);// 单链表删除pos位置之后的值
void SLTEraseAfter(SLTNode* pos);

2.3.2 -> SList.c

#include "SList.h"// 动态申请一个结点
SLTNode* BuySLTNode(SLTDateType x)
{SLTNode* newnode = (SLTNode*)malloc(sizeof(SLTNode));if (newnode == NULL){perror("malloc fail");return NULL;}newnode->data = x;newnode->next = NULL;return newnode;
}// 单链表的打印
void SLTPrint(SLTNode* phead)
{SLTNode* cur = phead;while (cur != NULL){printf("%d->", cur->data);cur = cur->next;}printf("NULL\n");
}// 单链表的尾插
void SLTPushBack(SLTNode** pphead, SLTDateType x)
{assert(pphead);SLTNode* newnode = BuySLTNode(x);if (*pphead == NULL){*pphead = newnode;}else{SLTNode* cur = *pphead;while (cur->next != NULL){cur = cur->next;}cur->next = newnode;}
}// 单链表的头插
void SLTPushFront(SLTNode** pphead, SLTDateType x)
{assert(pphead);SLTNode* newnode = BuySLTNode(x);newnode->next = *pphead;*pphead = newnode;
}// 单链表的尾删
void SLTPopBack(SLTNode** pphead)
{assert(pphead);assert(*pphead); // 暴力检查温柔的检查//if (*pphead == NULL)//{//	return;//}// 只有一个节点if ((*pphead)->next == NULL){free(*pphead);*pphead = NULL;}// 有多个节点else{SLTNode* prev = *pphead;SLTNode* tail = *pphead;while (tail->next != NULL){prev = tail;tail = tail->next;}free(tail);tail = NULL;prev->next = NULL;}
}// 单链表的头删
void SLTPopFront(SLTNode** pphead)
{assert(*pphead);SLTNode* tail = *pphead;*pphead = (*pphead)->next;free(tail);tail = NULL;
}// 单链表的查找
SLTNode* SLTFind(SLTNode* phead, SLTDateType x)
{SLTNode* ptr = phead;while (ptr->next != NULL){if (ptr->data == x){return ptr;}else{ptr = ptr->next;}}return NULL;
}// 单链表在pos位置之前插入x
void SLTInsert(SLTNode** pphead, SLTNode* pos, SLTDateType x)
{assert(pphead);assert(pos);if (pos == *pphead){SLTPushFront(pphead, x);}else{SLTNode* newnode = BuySLTNode(x);SLTNode* prev = *pphead;while (prev->next != pos){prev = prev->next;}prev->next = newnode;newnode->next = pos;}
}// 单链表在pos位置之后插入x
void SLTInsertAfter(SLTNode* pos, SLTDateType x)
{assert(pos);SLTNode* newnode = BuySLTNode(x);SLTNode* tmp = pos->next;pos->next = newnode;newnode->next = tmp;
}// 单链表删除pos位置的值
void SLTErase(SLTNode** pphead, SLTNode* pos)
{assert(pphead);assert(*pphead);assert(pos);if (pos == *pphead){SLTPopFront(pphead);}else{SLTNode* prev = *pphead;if (prev->next != pos){prev = prev->next;}prev->next = pos->next;free(pos);pos = NULL;}
}// 单链表删除pos位置之后的值
void SLTEraseAfter(SLTNode* pos)
{assert(pos);assert(pos->next);SLTNode* tmp = pos->next->next;free(pos->next);pos->next = tmp;
}

2.3.3 -> Test.c

#include "SList.h"// 尾插测试
void SLTTest1()
{SLTNode* plist = NULL;SLTPushBack(&plist, 1);SLTPushBack(&plist, 2);SLTPushBack(&plist, 3);SLTPushBack(&plist, 4);SLTPrint(plist);
}// 头插测试
void SLTTest2()
{SLTNode* plist = NULL;SLTPushFront(&plist, 1);SLTPushFront(&plist, 2);SLTPushFront(&plist, 3);SLTPushFront(&plist, 4);SLTPrint(plist);
}// 尾删测试
void SLTTest3()
{SLTNode* plist = NULL;SLTPushBack(&plist, 1);SLTPushBack(&plist, 2);SLTPushBack(&plist, 3);SLTPushBack(&plist, 4);SLTPrint(plist);SLTPopBack(&plist);SLTPrint(plist);SLTPopBack(&plist);SLTPrint(plist);SLTPopBack(&plist);SLTPrint(plist);SLTPopBack(&plist);SLTPrint(plist);
}// 头删测试
void SLTTest4()
{SLTNode* plist = NULL;SLTPushBack(&plist, 1);SLTPushBack(&plist, 2);SLTPushBack(&plist, 3);SLTPushBack(&plist, 4);SLTPrint(plist);SLTPopFront(&plist);SLTPrint(plist);SLTPopFront(&plist);SLTPrint(plist);SLTPopFront(&plist);SLTPrint(plist);SLTPopFront(&plist);SLTPrint(plist);
}// 查找测试
void SLTTest5()
{SLTNode* plist = NULL;SLTPushBack(&plist, 1);SLTPushBack(&plist, 2);SLTPushBack(&plist, 3);SLTPushBack(&plist, 4);SLTPrint(plist);SLTNode* ans = SLTFind(plist, 1);if (ans)ans->data = 10;SLTPrint(plist);
}// 在pos位置之前插入x测试
void SLTTest6()
{SLTNode* plist = NULL;SLTPushBack(&plist, 1);SLTPushBack(&plist, 2);SLTPushBack(&plist, 3);SLTPushBack(&plist, 4);SLTPrint(plist);SLTNode* pos = SLTFind(plist, 2);if (pos)SLTInsert(&plist, pos, 99);SLTPrint(plist);
}// 在pos位置之后插入x测试
void SLTTest7()
{SLTNode* plist = NULL;SLTPushBack(&plist, 1);SLTPushBack(&plist, 2);SLTPushBack(&plist, 3);SLTPushBack(&plist, 4);SLTPrint(plist);SLTNode* pos = SLTFind(plist, 2);if (pos)SLTInsertAfter(pos, 99);SLTPrint(plist);
}// 删除pos位置的值测试
void SLTTest8()
{SLTNode* plist = NULL;SLTPushBack(&plist, 1);SLTPushBack(&plist, 2);SLTPushBack(&plist, 3);SLTPushBack(&plist, 4);SLTPrint(plist);SLTNode* pos = SLTFind(plist, 2);if (pos)SLTErase(&plist, pos);SLTPrint(plist);
}// 删除pos位置之后的值测试
void SLTTest9()
{SLTNode* plist = NULL;SLTPushBack(&plist, 1);SLTPushBack(&plist, 2);SLTPushBack(&plist, 3);SLTPushBack(&plist, 4);SLTPrint(plist);SLTNode* pos = SLTFind(plist, 2);if (pos)SLTEraseAfter(pos);SLTPrint(plist);
}int main()
{return 0;
}

感谢大佬们的支持!!!

互三啦!!!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://xiahunao.cn/news/2815501.html

如若内容造成侵权/违法违规/事实不符,请联系瞎胡闹网进行投诉反馈,一经查实,立即删除!

相关文章

React 模态框的设计(三)拖动组件的完善

我在上次的Draggable组件的设计中给了一个简化的方法&#xff0c;今天我来完善一下这个组件&#xff0c;可用于任何可移动组件的包裹。完善后的效果如下所示&#xff1a; 这个优化中&#xff0c;增加了一个注目的效果&#xff0c;还增加了触发可拖动区域的指定功能&#xff0c;…

设置虚拟内存

目录 1.作用&#xff1a;2.步骤&#xff1a;小结&#xff1a; 1.作用&#xff1a; 电脑的物理内存不够用时把一部分硬盘空间作为内存来使用&#xff0c;这部分硬盘空间就叫作虚拟内存。 2.步骤&#xff1a; 右键 我的电脑 属性 点到这里&#xff0c;取消勾选 选择好盘符和…

新版内容管理系统(CMS)搭建教程

基于云开发搭建的可视化的内容管理平台&#xff08;CMS&#xff09;&#xff0c;新版内容管理系统&#xff08;CMS&#xff09;搭建教程。由公~号&#xff08;木番薯科技&#xff09;提供教程支持。 1、云开发 2、更多 3、内容管理 4、去使用 5、允许 6、下一步 7、开始 8、开…

多特征变量序列预测(10)基于麻雀优化算法的CEEMDAN-SSA-Transformer-BiLSTM预测模型

目录 往期精彩内容&#xff1a; 前言 1 多特征变量数据集制作与预处理 1.1 导入数据 1.2 CEEMDAN分解 1.3 数据集制作与预处理 2 麻雀优化算法 2.1 麻雀优化算法介绍 2.2 基于Python的麻雀优化算法实现 2.3 麻雀优化算法-超参数寻优过程 3 基于Pytorch的CEEMDAN SSA…

动态规划(算法竞赛、蓝桥杯)--深入浅出的完全背包DP

1、B站视频链接&#xff1a;E09【模板】背包DP 完全背包_哔哩哔哩_bilibili #include <bits/stdc.h> using namespace std; const int N1010; int n,m; int v[N],w[N],f[N][N];int main(){scanf("%d%d",&n,&m);for(int i1;i<n;i){scanf("%d%d…

《计算机系统结构教程第三版课后习题答案》第一章作业手写答案

1.7 计算机系统结构计算题27、用一台40M Hz 处理机执行标准测试程序&#xff0c;它含的混合指令数和相应的时钟周期数如下&#xff1a;指令类型指令数时钟周期数整数运算450001数据传送320002浮点150002控制传送80002计算&#xff1a;(1)有效 CPI (2) MIPS (3&#xff09;程序的…

flutter 人机验证实战

先看效果 基本思路 接口进行触发是否进行图像验证&#xff0c;验证后将结果携带到接口里面去&#xff0c;进行人机验证 使用的技术(可惜只有web版本的) 验证码2.0智能人机验证(VAPTCHA)- 安全、易用、完全免费手势验证码VAPTCHA是基于人工智能和大数据的次世代人机验证解决方案…

【JavaEE进阶】图书管理系统开发日记——捌

文章目录 &#x1f343;前言&#x1f38d;统一数据返回格式&#x1f6a9;快速入门&#x1f6a9;存在问题&#x1f388;问题原因&#x1f388;代码修改 &#x1f6a9;统一格式返回的优点 &#x1f340;统一异常处理&#x1f332;前端代码的修改&#x1f6a9;登录页面&#x1f6a…

单片机复位按键电路、唤醒按键电路

目录 单片机复位按键 外部手动复位 单片机复位按键电路 复位按键电路1 复位按键电路2 单片机唤醒按键 单片机唤醒按键电路 单片机复位按键 单片机复位&#xff1a;简单来说&#xff0c;复位引脚就是有复位信号&#xff0c;就是从头开始执行程序 本质&#xff1a;就是靠…

NC65 rest接口 开发 NC65接口开发

一、在对应模块META-INF下编写 xxx.rest 文件,也要放在Home里对应的目录下。 二、开发接口&#xff0c;继承extends AbstractUAPRestResource&#xff0c;&#xff08;有的项目会继承别的方法如&#xff1a;AbstractNCCRestResource&#xff0c;MTFRestResource&#xff1b;有…

智能水表预付费管理系统

智能水表预付费管理系统是当前智能水表技术的重要应用之一&#xff0c;结合了智能化管理和预付费功能&#xff0c;为水务公司和用户提供了便捷、高效的用水管理解决方案。该系统利用先进的科技手段&#xff0c;实现了水表抄表、计费和管理的自动化&#xff0c;为用户带来更便捷…

C++ Webserver从零开始:代码书写(十六)——配置文件,服务器,启动!

前言 现在是2024年2月28日的晚上20点36分&#xff0c;我完成了博客的所有内容。现在我整个人有一种如释重负的感觉&#xff0c;今天用webbench测试的时候还闹了个笑话&#xff0c;我在使用测试命令时&#xff0c;url多写了一个http://没注意&#xff0c;导致webbench访问服务器…

基于Python3的数据结构与算法 - 05 堆排序

目录 一、堆排序之树的基础知识 1. 树的定义 2. 树的一些概念 二、堆排序二叉树的基本知识 1. 二叉树的定义 2. 二叉树的存储方式&#xff08;表达方式&#xff09; 2.1 顺序存储方式 三、堆 1. 堆的定义 2. 堆的向下调整性质 四、堆排序的过程 1. 建造堆 五、时…

SpringCloud认识微服务

文章目录 1.1.单体架构1.2.分布式架构1.3.微服务1.4.SpringCloud1.5.总结 随着互联网行业的发展&#xff0c;对服务的要求也越来越高&#xff0c;服务架构也从单体架构逐渐演变为现在流行的微服务架构。这些架构之间有怎样的差别呢&#xff1f; 微服务架构是一种架构模式&…

软考51-上午题-【数据库】-索引

一、索引的定义 在数据库中&#xff0c;索引使得数据库程序无需对整个表进行扫描&#xff0c;就可以在其中找到所需数据。数据库中的索引是某个表中一列或者若干列&#xff0c;值的集合和相应的指向表中物理标识这些值的数据页逻辑指针清单。 二、索引的创建和删除 2-1、索引…

ThreeJS 几何体顶点position、法向量normal及uv坐标

文章目录 几何体的顶点position、法向量normal及uv坐标UV映射UV坐标系UV坐标与顶点坐标设置UV坐标案例1&#xff1a;使用PlaneGeometry创建平面缓存几何体案例2&#xff1a;使用BufferGeometry创建平面缓存几何体 法向量 - 顶点法向量光照计算案例1&#xff1a;不设置顶点法向量…

Linux shell:补充命令的使用

目录 一.导读 二.正文 三.结语 一.导读 上一篇介绍了脚本的简单概念以及使用&#xff0c;现在补充一些命令。 二.正文 目前处于全局目录&#xff0c;通过mkdir创建名我为day01的文件。 通过cd命令day01 切换至day01文件当中。 使用vim文本编辑器文件名&#xff08;firstdir&…

【algorithm】算法基础课---排序算法(附笔记 | 建议收藏)

&#x1f680;write in front&#x1f680; &#x1f4dd;个人主页&#xff1a;认真写博客的夏目浅石. &#x1f381;欢迎各位→点赞&#x1f44d; 收藏⭐️ 留言&#x1f4dd; &#x1f4e3;系列专栏&#xff1a;AcWing算法学习笔记 &#x1f4ac;总结&#xff1a;希望你看完…

day 45 ● 70. 爬楼梯 (进阶)● 322. 零钱兑换 ● 279.完全平方数

#include<bits/stdc.h> using namespace std; int main(){int n,m;cin>>n>>m;vector<int> dp(33,0);dp[0]1;for(int i0;i<n;i){for(int j1;j<m;j){if(i>j)dp[i]dp[i-j];}}// return dp[n];cout<<dp[n]<<endl;} 当然注意 力扣是 …

2.23作业

1.自己实现单向循环链表的功能 //loop_list.c#include"loop_list.h" //创建单向循环链表 loop_p create_head() {loop_p H(loop_p)malloc(sizeof(loop_list));if(HNULL){printf("空间申请失败\n");return NULL;}H->len0;H->nextH;return H; }//创建…