#include<stdio.h> #include<stdlib.h> struct node{ int date; struct node* next; }; struct node* creat(int info){ //创建一个节点 struct node* newnode=(struct node*)malloc(sizeof(struct node)); if(newnode==NULL){ printf("error\n"); exit(1); } newnode->date=info; newnode->next=NULL; return newnode; } void add(struct node** head, int info){ //在链尾接上节点 struct node* newnode=creat(info); if(*head==NULL){ *head =newnode; return; } struct node* now=*head;//当前指针不为空 while(now->next!=NULL){ now=now->next; } now->next=newnode; } void coutout(struct node* head){ //遍历链表输出 struct node* now=head; printf("following is the list:\n"); while(now!=NULL){ printf("%d ",now->date); now=now->next; } printf("\n"); } void freelist(struct node* head){ //释放内存 struct node* t; while(head!=NULL){ t=head; head=head->next; free(t); } } void insert(struct node* head,int k,int date){ //插入节点 if(head==NULL){ printf("empty\n"); return; } struct node* now=head; for(int i=1;i<k&&now!=NULL;i++){ now=now->next; } if(now==NULL){ printf("over the list\n"); return; } struct node* newnode=creat(date); newnode->next=now->next; now->next=newnode; } void deletenode(struct node** head,int k){ if(*head==NULL){ printf("the list is empty\n"); return; } struct node* now=*head; struct node* prev=NULL; for(int i=1;i<k&&now!=NULL;i++){ prev=now; now=now->next; } if(now==NULL){ printf("over the list\n"); return; } if(prev==NULL){ *head=now->next; }else{ prev->next=now->next; } free(now); } int main(){ struct node* head=NULL; int num; scanf("%d",&num); while(num--){ int t; scanf("%d",&t); add(&head,t); } coutout(head); freelist(head); }C语言链表2
张小明
前端开发工程师
Android基础-Activity属性 android:configChanges
<activityandroid:name".activity.MoreFuncActivity"android:exported"false"android:configChanges"keyboardHidden|orientation|screenSize|navigation|keyboard" /> 项目清单文件中看到 android:configChanges"keyboardHidden|…
Kotaemon支持CI/CD持续集成部署吗?DevOps整合
Kotaemon支持CI/CD持续集成部署吗?DevOps整合 在企业级AI系统日益复杂的今天,一个常见的挑战浮出水面:如何将大语言模型(LLM)驱动的智能体从实验室原型平稳地推向生产环境?许多团队经历过这样的窘境——本地…
KotaemonA/B测试方案设计:实验组划分指导
Kotaemon A/B测试方案设计:实验组划分实践指南 在智能客服和企业级知识管理场景中,一个问答系统的准确性不再仅仅取决于大模型的能力,更依赖于背后整套检索增强生成(RAG)流程的精细调优。我们常常会遇到这样的问题&…
基于Kotaemon的会议室预订智能助手开发
基于Kotaemon的会议室预订智能助手开发 在现代企业办公环境中,一个看似简单的任务——“订个会议室”——却常常演变成一场耗时的协调战。员工需要打开日历系统、手动筛选空闲时段、确认设备配置、检查权限、拉群通知同事……稍有疏忽,就可能出现时间冲…
Kotaemon助力企业构建私有化知识库问答系统
Kotaemon助力企业构建私有化知识库问答系统 在当今企业数字化转型的浪潮中,知识不再只是静态文档的堆砌,而是驱动效率与决策的核心资产。然而,当员工面对分布在Confluence、SharePoint、本地服务器甚至个人笔记中的海量资料时,“我…
Kotaemon微服务架构拆分建议:适应大规模部署
Kotaemon微服务架构拆分建议:适应大规模部署 在企业智能对话系统逐渐成为客服、知识管理与自动化办公核心组件的今天,一个关键问题摆在了架构师面前:如何让原本为本地开发设计的AI框架,顺利演进为支撑高并发、可扩展、易维护的企业…