#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
张小明
前端开发工程师
Kotaemon工单系统联动:Jira/ServiceNow操作
Kotaemon工单系统联动:Jira/ServiceNow操作 在现代企业IT运维的日常中,一个常见的场景是:某位员工发现会议室打印机无法连接,随即在协作工具里发了一条消息:“今天开会时投影连不上,谁帮忙看看?…
AI在智能物流路径规划与车辆调度中的实时优化应用
AI在智能物流路径规划与车辆调度中的实时优化应用 关键词:AI、智能物流、路径规划、车辆调度、实时优化 摘要:本文深入探讨了AI在智能物流路径规划与车辆调度实时优化中的应用。详细介绍了相关的核心概念、算法原理、数学模型,通过项目实战展示了代码实现及解读。同时,阐述…
Revit 200+新功能之“明周科技功能商店 AI推荐助手”
# 简介🎯 开发背景与初衷随着我们 Revit 插件不断演进,用户在线提交的功能需求已接近 200 项,涵盖图纸生成、构件建模、参数赋值、数据统计、标高调整等多个方向。虽然我们已将这些功能模块化、面板化管理,但功能数量庞大后&#…
Kotaemon中的评分机制如何判断答案可靠性?
Kotaemon中的评分机制如何判断答案可靠性? 在企业级智能问答系统日益普及的今天,一个看似流畅的回答背后,可能隐藏着致命的风险——模型“自信地胡说八道”。这种现象在金融咨询、医疗建议或法律条款解释中尤为危险。用户真正需要的不是最流…
Kotaemon跨界联名创意:品牌合作点子库
Kotaemon跨界联名创意:品牌合作点子库 在智能客服逐渐从“能说话”迈向“懂业务”的今天,越来越多企业发现,一个真正可用的AI助手,远不止是调用大模型生成几句回复那么简单。它需要理解上下文、引用真实知识、执行具体任务&#x…
【毕设项目计算机毕设】基于springboot+vue实现的员工管理系统视频讲解数据库项目源码
如需获取源码和观看运行以及配置视频,可通过下面地址访问观看 https://www.simgle123.top/1152 技术概述 系统所需的环境和技术为: jdk1.8 maven3.6 springboot2 mysql8.0 vue2.0 nodejs12.14.0 element-ui mybatis-plus 功能概述 3.1、页面…