当前位置: 首页 > news >正文

【数据结构初阶】栈和队列

栈和队列

    • 1.栈
      • 1.1栈的概念和结构
      • 1.2栈的实现
    • 2.队列
      • 2.1队列的概念和结构
      • 2.2队列的实现

1.栈

1.1栈的概念和结构

栈:一种特殊的线性表,其只允许在固定的一端进行插入和删除元素操作。进行数据插入和删除操作的一端称为栈顶,另一端称为栈底。栈中的数据元素遵守后进先出LIFO(Last In First Out)的原则。
压栈:栈的插入操作叫做进栈/压栈/入栈,入数据在栈顶。
出栈:栈的删除操作叫做出栈。出数据也在栈顶。
在这里插入图片描述
在这里插入图片描述

1.2栈的实现

栈的实现一般可以使用数组或者链表实现,相对而言数组的结构实现更优一些。因为数组在尾上插入数据的代价比较小
在这里插入图片描述
在这里插入图片描述

Stack.h

#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
#include<stdbool.h>typedef int STDateType;
typedef struct Stack
{STDateType* a;int top;int capacity;
}ST;//初始化
void STInit(ST* ps);//销毁
void STDestroy(ST* ps);//入栈
void STPush(ST* ps, STDateType x);//出栈
void STPop(ST* ps);//栈顶
STDateType SLTTop(ST* ps);//计算大小
int STSize(ST* ps);//判断是否为空
bool STEmpty(ST* ps);

Stack.c

#include"Stack.h"//初始化
void STInit(ST* ps)
{assert(ps);ps->capacity = NULL;ps->a = 0;ps->top = 0;
}//销毁
void STDestroy(ST* ps)
{assert(ps);free(ps->a);ps->a = NULL;ps->capacity = ps->top = 0;
}//入栈
void STPush(ST* ps, STDateType x)
{assert(ps);if (ps->top == ps->capacity){int NewCapacity = ps->capacity == 0 ? 4 : ps->capacity * 2;STDateType* tmp = (STDateType*)realloc(ps->a, sizeof(STDateType) * NewCapacity);if (tmp == NULL){perror("realloc fail");exit(-1);}ps->a = tmp;ps->capacity = NewCapacity;}ps->a[ps->top] = x;ps->top++;
}//出栈
void STPop(ST* ps)
{assert(ps);assert(ps->a > 0);--ps->top;
}//栈顶
STDateType STTop(ST* ps)
{assert(ps);assert(ps->a > 0);return ps->a[ps->top - 1];
}//计算
int STSize(ST* ps)
{assert(ps);return ps->top;
}//判断是否为空
bool STEmpty(ST* ps)
{assert(ps);return ps->top == NULL;
}

test.c

#include"Stack.h"void TestStack()
{ST st;STInit(&st);STPush(&st, 1);STPush(&st, 2);STPush(&st, 3);STPush(&st, 4);STPush(&st, 5);while (!STEmpty(&st)){printf("%d ", STTop(&st));STPop(&st);}printf("\n");STDestroy(&st);
}int main()
{TestStack();return 0;
}

2.队列

2.1队列的概念和结构

队列:只允许在一端进行插入数据操作,在另一端进行删除数据操作的特殊线性表,队列具有先进先出FIFO(First In First Out) 入队列:进行插入操作的一端称为队尾出队列:进行删除操作的一端称为队头
在这里插入图片描述

2.2队列的实现

队列也可以数组和链表的结构实现,使用链表的结构实现更优一些,因为如果使用数组的结构,出队列在数组头上出数据,效率会比较低。
在这里插入图片描述

Queue.h

#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
#include<stdbool.h>
typedef int QDataType;
typedef struct QueueNode
{struct QueueNode* next;QDataType data;
}QNode;
typedef struct Queue
{QNode* head;QNode* tail;int size;
}Que;
void QueueInit(Que* pq);
void QueueDestroy(Que* pq);
void QueuePush(Que* pq, QDataType x);
void QueuePop(Que* pq);
QDataType QueueFront(Que* pq);
QDataType QueueBack(Que* pq);
bool QueueEmpty(Que* pq);
int QueueSize(Que* pq);

Queue.c

#include"Queue.h"//初始化
void QueueInit(Que* pq)
{assert(pq);pq->head = pq->tail = NULL;pq->size = 0;
}//销毁
void QueueDestroy(Que* pq)
{assert(pq);QNode* cur = pq->head;while (cur){QNode* next = cur->next;free(cur);cur = cur->next;}pq->head = pq->tail = NULL;pq->size = 0;
}//入队
void QueuePush(Que* pq, QDateType x)
{assert(pq);QNode* newnode = (QNode*)malloc(sizeof(QNode));if (newnode == NULL){perror("malloc fail");exit(-1);}newnode->date = x;newnode->next = NULL;if (pq->tail == NULL){pq->head = pq->tail = newnode;}else{pq->tail->next = newnode;pq->tail = newnode;}pq->size++;
}//出队
void QueuePop(Que* pq)
{assert(pq);assert(!QueueEmpty(pq));if (pq->head->next == NULL){pq->head = pq->tail = NULL;}else{QNode* next = pq->head->next;free(pq->head);pq->head = next;}pq->size--;
}//队头
QDateType QueueFront(Que* pq)
{assert(pq);assert(!QueueEmpty(pq));return pq->head->date;
}//队尾
QDateType QueueBack(Que* pq)
{assert(pq);assert(!QueueEmpty);return pq->tail->date;
}//判断是否为空
bool QueueEmpty(Que* pq)
{assert(pq);return pq->head == NULL;
}//计算
int QueueSize(Que* pq)
{assert(pq);return pq->size;
}

test.c

#include"Queue.h"void QueueTest()
{Que pq;QueueInit(&pq);QueuePush(&pq, 1);QueuePush(&pq, 2);QueuePush(&pq, 3);QueuePush(&pq, 4);while (!QueueEmpty(&pq)){printf("%d ", QueueFront(&pq));QueuePop(&pq);}printf("\n");QueueDestroy(&pq);
}int main()
{QueueTest();return 0;
}

3.栈和队列面试题

3.1括号匹配问题
OJ

#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
#include<stdbool.h>
//有效括号
typedef char STDateType;
typedef struct Stack
{STDateType* a;int top;int capacity;
}ST;
//初始化
void STInit(ST* ps);
//销毁
void STDestroy(ST* ps);
//入栈
void STPush(ST* ps, STDateType x);
//出栈
void STPop(ST* ps);
//栈顶
STDateType SLTTop(ST* ps);
//计算大小
int STSize(ST* ps);
//判断是否为空
bool STEmpty(ST* ps);//初始化
void STInit(ST* ps)
{assert(ps);ps->capacity = NULL;ps->a = 0;ps->top = 0;
}
//销毁
void STDestroy(ST* ps)
{assert(ps);free(ps->a);ps->a = NULL;ps->capacity = ps->top = 0;
}
//入栈
void STPush(ST* ps, STDateType x)
{assert(ps);if (ps->top == ps->capacity){int NewCapacity = ps->capacity == 0 ? 4 : ps->capacity * 2;STDateType* tmp = (STDateType*)realloc(ps->a, sizeof(STDateType) * NewCapacity);if (tmp == NULL){perror("realloc fail");exit(-1);}ps->a = tmp;ps->capacity = NewCapacity;}ps->a[ps->top] = x;ps->top++;
}
//出栈
void STPop(ST* ps)
{assert(ps);assert(ps->a > 0);--ps->top;
}
//栈顶
STDateType STTop(ST* ps)
{assert(ps);assert(ps->a > 0);return ps->a[ps->top - 1];
}
//计算
int STSize(ST* ps)
{assert(ps);return ps->top;
}
//判断是否为空
bool STEmpty(ST* ps)
{assert(ps);return ps->top == NULL;
}bool isValid(char* s) 
{ST st;STInit(&st);char topVal;while (*s){//数量不匹配if (*s == '(' || *s == '[' || *s == '{'){STPush(&st, *s);}else{if (STEmpty(&st)){STDestroy(&st);return false;}topVal = STTop(&st);STPop(&st);if ((*s == ')' && topVal != '(') || (*s == ']' && topVal != '[') || (*s == ' }' && topVal != '{')){STDestroy(&st);return false;}}s++;}//栈不为空,false,说明数量不匹配bool ret = STEmpty(&st);STDestroy(&st);return ret;
}int main()
{isValid("[(({})}]");#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
#include<stdbool.h>
typedef int STDateType;
typedef struct Stack
{STDateType* a;int top;int capacity;
}ST;
//初始化
void STInit(ST* ps);
//销毁
void STDestroy(ST* ps);
//入栈
void STPush(ST* ps, STDateType x);
//出栈
void STPop(ST* ps);
//栈顶
STDateType SLTTop(ST* ps);
//计算大小
int STSize(ST* ps);
//判断是否为空
bool STEmpty(ST* ps);
//初始化
void STInit(ST* ps)
{assert(ps);ps->capacity = NULL;ps->a = 0;ps->top = 0;
}
//销毁
void STDestroy(ST* ps)
{assert(ps);free(ps->a);ps->a = NULL;ps->capacity = ps->top = 0;
}
//入栈
void STPush(ST* ps, STDateType x)
{assert(ps);if (ps->top == ps->capacity){int NewCapacity = ps->capacity == 0 ? 4 : ps->capacity * 2;STDateType* tmp = (STDateType*)realloc(ps->a, sizeof(STDateType) * NewCapacity);if (tmp == NULL){perror("realloc fail");exit(-1);}ps->a = tmp;ps->capacity = NewCapacity;}ps->a[ps->top] = x;ps->top++;
}
//出栈
void STPop(ST* ps)
{assert(ps);assert(ps->a > 0);--ps->top;
}
//栈顶
STDateType STTop(ST* ps)
{assert(ps);assert(ps->a > 0);return ps->a[ps->top - 1];
}
//计算
int STSize(ST* ps)
{assert(ps);return ps->top;
}
//判断是否为空
bool STEmpty(ST* ps)
{assert(ps);return ps->top == NULL;
}
typedef struct 
{ST pushst;ST popst;
} MyQueue;
MyQueue* myQueueCreate() 
{MyQueue* obj = (MyQueue*)malloc(sizeof(MyQueue));STInit(&obj->popst);STInit(&obj->pushst);return obj;
}void myQueuePush(MyQueue* obj, int x)
{STPush(&obj->pushst, x);
}int myQueuePeek(MyQueue* obj)
{if (STEmpty(&obj->popst)){while (!STEmpty(&obj->pushst)){STPush(&obj->popst, STTop(&obj->pushst));STPop(&obj->pushst);}}return STTop(&obj->popst);
}int myQueuePop(MyQueue* obj) 
{int front = myQueuePeek(obj);STPop(&obj->popst);return front;
}bool myQueueEmpty(MyQueue* obj) 
{return STEmpty(&obj->popst) && STEmpty(&obj->pushst);
}void myQueueFree(MyQueue* obj) 
{STDestroy(&obj->popst);STDestroy(&obj->pushst);free(obj);
}}

3.2用队列实现栈
OJ
在这里插入图片描述
在这里插入图片描述

3.3用栈实现队列
OJ
在这里插入图片描述

#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
#include<stdbool.h>
typedef int STDateType;
typedef struct Stack
{STDateType* a;int top;int capacity;
}ST;
//初始化
void STInit(ST* ps);
//销毁
void STDestroy(ST* ps);
//入栈
void STPush(ST* ps, STDateType x);
//出栈
void STPop(ST* ps);
//栈顶
STDateType SLTTop(ST* ps);
//计算大小
int STSize(ST* ps);
//判断是否为空
bool STEmpty(ST* ps);
//初始化
void STInit(ST* ps)
{assert(ps);ps->capacity = NULL;ps->a = 0;ps->top = 0;
}
//销毁
void STDestroy(ST* ps)
{assert(ps);free(ps->a);ps->a = NULL;ps->capacity = ps->top = 0;
}
//入栈
void STPush(ST* ps, STDateType x)
{assert(ps);if (ps->top == ps->capacity){int NewCapacity = ps->capacity == 0 ? 4 : ps->capacity * 2;STDateType* tmp = (STDateType*)realloc(ps->a, sizeof(STDateType) * NewCapacity);if (tmp == NULL){perror("realloc fail");exit(-1);}ps->a = tmp;ps->capacity = NewCapacity;}ps->a[ps->top] = x;ps->top++;
}
//出栈
void STPop(ST* ps)
{assert(ps);assert(ps->a > 0);--ps->top;
}
//栈顶
STDateType STTop(ST* ps)
{assert(ps);assert(ps->a > 0);return ps->a[ps->top - 1];
}
//计算
int STSize(ST* ps)
{assert(ps);return ps->top;
}
//判断是否为空
bool STEmpty(ST* ps)
{assert(ps);return ps->top == NULL;
}
typedef struct 
{ST pushst;ST popst;
} MyQueue;
MyQueue* myQueueCreate() 
{MyQueue* obj = (MyQueue*)malloc(sizeof(MyQueue));STInit(&obj->popst);STInit(&obj->pushst);return obj;
}void myQueuePush(MyQueue* obj, int x)
{STPush(&obj->pushst, x);
}int myQueuePeek(MyQueue* obj)
{if (STEmpty(&obj->popst)){while (!STEmpty(&obj->pushst)){STPush(&obj->popst, STTop(&obj->pushst));STPop(&obj->pushst);}}return STTop(&obj->popst);
}int myQueuePop(MyQueue* obj) 
{int front = myQueuePeek(obj);STPop(&obj->popst);return front;
}bool myQueueEmpty(MyQueue* obj) 
{return STEmpty(&obj->popst) && STEmpty(&obj->pushst);
}void myQueueFree(MyQueue* obj) 
{STDestroy(&obj->popst);STDestroy(&obj->pushst);free(obj);
}

3.4设计循环队列
OJ
在这里插入图片描述
在这里插入图片描述

#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
#include<stdbool.h>
//计循环队列
typedef struct 
{int* a;int front;int rear;int k;
} MyCircularQueue;MyCircularQueue* myCircularQueueCreate(int k) 
{MyCircularQueue* obj = (MyCircularQueue*)malloc(sizeof(MyCircularQueue));obj->a = (int*)malloc(sizeof(int) * (k + 1));obj->front = obj->rear = 0;obj->k = k;return obj;
}bool myCircularQueueIsEmpty(MyCircularQueue* obj)
{return obj->front == obj->rear;
}bool myCircularQueueIsFull(MyCircularQueue* obj)
{return (obj->rear + 1) % (obj->k + 1) == obj->front;
}bool myCircularQueueEnQueue(MyCircularQueue* obj, int value)
{if (myCircularQueueIsFull(obj))return false;obj->a[obj->rear] = value;obj->rear++;obj->rear %= (obj->k + 1);return true;
}bool myCircularQueueDeQueue(MyCircularQueue* obj) 
{if (myCircularQueueIsEmpty(obj))return false;obj->front++;obj->front %= (obj->k + 1);return true;
}int myCircularQueueFront(MyCircularQueue* obj) 
{if (myCircularQueueIsEmpty(obj))return -1;return obj->a[obj->front];
}int myCircularQueueRear(MyCircularQueue* obj)
{if (myCircularQueueIsEmpty(obj))return -1;return obj->a[(obj->rear + obj->k) % (obj->k + 1)];
}void myCircularQueueFree(MyCircularQueue* obj)
{free(obj->a);free(obj);
}

💘不知不觉,【数据结构初阶】栈和队列以告一段落。通读全文的你肯定收获满满,让我们继续为数据结构学习共同奋进!!!

相关文章:

【数据结构初阶】栈和队列

栈和队列 1.栈1.1栈的概念和结构1.2栈的实现 2.队列2.1队列的概念和结构2.2队列的实现 1.栈 1.1栈的概念和结构 栈&#xff1a;一种特殊的线性表&#xff0c;其只允许在固定的一端进行插入和删除元素操作。进行数据插入和删除操作的一端称为栈顶&#xff0c;另一端称为栈底。…...

MATLAB - text的两种使用方法

text小技巧 1. 常规使用&#xff08;Method 1&#xff09;2. 在显示画面的相对位置&#xff08;Method 2&#xff09;3. 举个例子 1. 常规使用&#xff08;Method 1&#xff09; text(x,y,txt)2. 在显示画面的相对位置&#xff08;Method 2&#xff09; text(string,‘ABC’,…...

ubuntu下配置qtcreator交叉编译环境

文章目录 安装交叉编译工具安装qt creator开发环境配置交叉编译示例demo参考 安装交叉编译工具 安装qt creator开发环境 1 官网 2 填写信息 3 下载 默认没有出现Qt5.15版本 WISONIC\80081001ub16-1001:~$ /opt/Qt/Tools/QtCreator/bin/qtcreator /opt/Qt/Tools/QtCreat…...

金风玉露一相逢|实在智能联手浪潮信息合力致新生成式AI产业生态

近日&#xff0c;实在智能正式加入浪潮信息元脑生态AIStore。 实在智能是一家基于AGI大模型超自动化技术&#xff0c;领跑人机协同时代的人工智能科技公司&#xff0c;以其自研垂直的“TARS&#xff08;塔斯&#xff09;大语言模型”技术、实在RPA Agent智能体数字员工产品和超…...

Design Guidelines for 100 Gbps

文章目录 Stratix V GT Transceiver ChannelsCFP2 Host Connector Assembly and PinoutStratix V GT to CFP2 Interface Layout DesignBoard Stack Up DimensionsExample Design Channel PerformanceSimulation Results for Stratix V GT to CFP2 Connector Layout Design Desi…...

苹果企业账号申请思考

苹果企业账号 好多年的企业账号想启用&#xff0c;但是没有找到入口&#xff0c;直接联系了一下苹果的技术支持。通过邮件联系&#xff0c;之后他们回电&#xff0c;吧啦吧啦问了一大堆关于企业账号的事情&#xff0c;他们对这个还挺关注的&#xff0c;主要是集中在是否是有必…...

【C/C++】素数专题

素数专题 1.判断素数模板2.求范围内的素数&#xff08;101-200&#xff09;3.判断素数与分解 1.判断素数模板 #include<stdio.h> #include<math.h>int prism(int n){if(n1) return 0;for(int i2;i<sqrt(n);i){if(n%i0) return 0;}return 1; }int main() {int n…...

Apple Vision Pro 开发机申请

申请地址: &#xff08;免费租用形式&#xff09; Developer Kit - visionOS - Apple Developer 上海Apple Lab 互动申请&#xff1a; View - Meet with Apple Experts - Apple Developer (需要完善的产品才能去测试哦) 它是如何工作的 我们将借给你一个Apple Vision Pro开发…...

NFS服务器搭建 配置nfs共享目录

一定要用二级目录&#xff0c;否则NFS坏了主机都启动不起来 一级目录是强制挂载&#xff0c;二级目录是动态挂载 nfs共享远程目录具体步骤&#xff1a; 服务器端配置&#xff1a; 1.安装NFS服务器软件 sudo apt-get install nfs-kernel-server # 安装 NFS服务器端 2.添加…...

springboot+bootstrap+java农业电商服务商城系统_30249

本农业电商服务系统是为了提高用户查阅信息的效率和管理人员管理信息的工作效率&#xff0c;可以快速存储大量数据&#xff0c;还有信息检索功能&#xff0c;这大大的满足了管理员、会员和商家这三者的需求。操作简单易懂&#xff0c;合理分析各个模块的功能&#xff0c;尽可能…...

【shell】脚本实现将开发机user1账户下的abc文件夹复制到user2~4账户下

1 主要内容 可以使用Shell脚本来实现将开发机&#xff08;Linux&#xff09;上user1账户下的abc文件夹复制到user2、user3和user4账户下。 #!/bin/bash# 数组赋值&#xff0c;目标用户列表 # target_users(user2 user3 user4) # 定义数组 target_users()# 生成user数字的数组…...

steamui.dll找不到指定模块,要怎么修复steamui.dll文件

当我们使用Steam进行游戏时&#xff0c;有时可能会面对一些令人无奈的技术问题。一种常见的问题是“找不到指定模块steamui.dll”&#xff0c;这可能是由于缺少文件、文件损坏或软件冲突等原因导致。但别担心&#xff0c;这篇文章将提供几种解决此问题的方法&#xff0c;并针对…...

鸿蒙原生应用/元服务开发-AGC分发如何上架HarmonyOS应用

一、上架整体流程 二、上架HarmonyOS应用 获取到HarmonyOS应用软件包后&#xff0c;开发者可将应用提交至AGC申请上架。上架成功后&#xff0c;用户即可在华为应用市场搜索获取开发者的HarmonyOS应用。 配置应用信息 1.登录AppGallery Connect&#xff0c;选择“我的应用”。…...

基于单片机仓库温湿度监测报警系统仿真设计

**单片机设计介绍&#xff0c;基于单片机仓库温湿度监测报警系统仿真设计 文章目录 一 概要二、功能设计设计思路 三、 软件设计原理图 五、 程序六、 文章目录 一 概要 基于单片机的仓库温湿度监测报警系统可以被设计成能够实时监测仓库内的温度和湿度&#xff0c;并根据预设…...

中文rlhf数据集50w条数据解析

中文rlhf数据集50w条数据解析 解析代码数据名代码解析 解析代码 import jieba from tqdm import tqdm import re import pandas as pd import numpy as npdef find_non_english_text(text):pattern re.compile(r[^a-zA-Z])return pattern.sub(, text)def find_chinese_text(t…...

解决解析PDF编码报错(以pdfminer为例):UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte xxx

解决方法 博主使用的是pdfminer解析PDF文档&#xff0c;这个解决方法是通用的&#xff0c;只需要使PDFParser传入的文件为二进制文件即可&#xff0c;示例程序&#xff1a; from pdfminer.pdfparser import PDFParserpdf_parser PDFParser(open("pdf文件.pdf", &q…...

chatGPT2:如何构建一个可以回答有关您网站问题的 AI 嵌入(embeddings)

感觉这个目前没有什么用&#xff0c;因为客户可以直接问通用chatGPT&#xff0c;实时了解你网站内的信息&#xff0c;除非你的网站chatGPT无法访问。 不过自动预订、买票等用嵌入还是挺有用的。 什么是嵌入&#xff1f; OpenAI的嵌入&#xff08;embeddings&#xff09;是一种…...

Vue3-新特性defineOptions和defineModel

defineOptions 问题&#xff1a;用了<script setup>后&#xff0c;就无法添加与其平级的属性了&#xff0c;比如定义组件的name或其他自定义的属性。 为了解决这一问题&#xff0c;引入了defineProps与defineEmits这两个宏&#xff0c;但这只解决了props与emits这两个属…...

【计算机基础】通过插件plantuml,实现在VScode里面绘制状态机

&#x1f4e2;&#xff1a;如果你也对机器人、人工智能感兴趣&#xff0c;看来我们志同道合✨ &#x1f4e2;&#xff1a;不妨浏览一下我的博客主页【https://blog.csdn.net/weixin_51244852】 &#x1f4e2;&#xff1a;文章若有幸对你有帮助&#xff0c;可点赞 &#x1f44d;…...

Linux常用基础命令及重要目录,配置文件功能介绍

目录 一&#xff0c;Linux常用必备基础命令 1&#xff0c;网络类命令 2&#xff0c;文件目录类命令 3&#xff0c;操作类命令 4&#xff0c;关机重启命令 5&#xff0c;帮助命令 6&#xff0c;查看显示类命令 7&#xff0c;命令常用快捷键 二&#xff0c;Linux重要目录…...

2023赣州旅游投资集团

单选题 1.“不登高山&#xff0c;不知天之高也&#xff1b;不临深溪&#xff0c;不知地之厚也。”这句话说明_____。 A、人的意识具有创造性 B、人的认识是独立于实践之外的 C、实践在认识过程中具有决定作用 D、人的一切知识都是从直接经验中获得的 参考答案: C 本题解…...

JavaScript 数据类型详解

JavaScript 数据类型详解 JavaScript 数据类型分为 原始类型&#xff08;Primitive&#xff09; 和 对象类型&#xff08;Object&#xff09; 两大类&#xff0c;共 8 种&#xff08;ES11&#xff09;&#xff1a; 一、原始类型&#xff08;7种&#xff09; 1. undefined 定…...

OD 算法题 B卷【正整数到Excel编号之间的转换】

文章目录 正整数到Excel编号之间的转换 正整数到Excel编号之间的转换 excel的列编号是这样的&#xff1a;a b c … z aa ab ac… az ba bb bc…yz za zb zc …zz aaa aab aac…; 分别代表以下的编号1 2 3 … 26 27 28 29… 52 53 54 55… 676 677 678 679 … 702 703 704 705;…...

Python 高级应用10:在python 大型项目中 FastAPI 和 Django 的相互配合

无论是python&#xff0c;或者java 的大型项目中&#xff0c;都会涉及到 自身平台微服务之间的相互调用&#xff0c;以及和第三发平台的 接口对接&#xff0c;那在python 中是怎么实现的呢&#xff1f; 在 Python Web 开发中&#xff0c;FastAPI 和 Django 是两个重要但定位不…...

Python爬虫实战:研究Restkit库相关技术

1. 引言 1.1 研究背景与意义 在当今信息爆炸的时代,互联网上存在着海量的有价值数据。如何高效地采集这些数据并将其应用于实际业务中,成为了许多企业和开发者关注的焦点。网络爬虫技术作为一种自动化的数据采集工具,可以帮助我们从网页中提取所需的信息。而 RESTful API …...

goreplay

1.github地址 https://github.com/buger/goreplay 2.简单介绍 GoReplay 是一个开源的网络监控工具&#xff0c;可以记录用户的实时流量并将其用于镜像、负载测试、监控和详细分析。 3.出现背景 随着应用程序的增长&#xff0c;测试它所需的工作量也会呈指数级增长。GoRepl…...

麒麟系统使用-进行.NET开发

文章目录 前言一、搭建dotnet环境1.获取相关资源2.配置dotnet 二、使用dotnet三、其他说明总结 前言 麒麟系统的内核是基于linux的&#xff0c;如果需要进行.NET开发&#xff0c;则需要安装特定的应用。由于NET Framework 是仅适用于 Windows 版本的 .NET&#xff0c;所以要进…...

shell脚本质数判断

shell脚本质数判断 shell输入一个正整数,判断是否为质数(素数&#xff09;shell求1-100内的质数shell求给定数组输出其中的质数 shell输入一个正整数,判断是否为质数(素数&#xff09; 思路&#xff1a; 1:1 2:1 2 3:1 2 3 4:1 2 3 4 5:1 2 3 4 5-------> 3:2 4:2 3 5:2 3…...

高保真组件库:开关

一:制作关状态 拖入一个矩形作为关闭的底色:44 x 22,填充灰色CCCCCC,圆角23,边框宽度0,文本为”关“,右对齐,边距2,2,6,2,文本颜色白色FFFFFF。 拖拽一个椭圆,尺寸18 x 18,边框为0。3. 全选转为动态面板状态1命名为”关“。 二:制作开状态 复制关状态并命名为”开…...

【Java】Ajax 技术详解

文章目录 1. Filter 过滤器1.1 Filter 概述1.2 Filter 快速入门开发步骤:1.3 Filter 执行流程1.4 Filter 拦截路径配置1.5 过滤器链2. Listener 监听器2.1 Listener 概述2.2 ServletContextListener3. Ajax 技术3.1 Ajax 概述3.2 Ajax 快速入门服务端实现:客户端实现:4. Axi…...