#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
张小明
前端开发工程师
Eclipse+maven+selenium自动化测试用例入门
相关的开发环境搭建参考以下文章: Eclipsemavenselenium自动化测试开发环境搭建 确认环境搭建成功后,在src/test/java目录下,defaut package右键新建class,命名为:GoogleTest,相关代码如下: i…
Kotaemon在政务智能问答中的合规性设计考量
Kotaemon在政务智能问答中的合规性设计考量 在政务服务日益智能化的今天,公众对AI助手的期待早已超越了“能答上来”,而是要求它“答得准、说得清、可追溯”。一个回答错误可能误导市民错过申报时限,一次数据泄露可能动摇公众对数字政府的信任…
Kotaemon支持批量导入知识文档并自动索引
Kotaemon支持批量导入知识文档并自动索引 在企业智能化转型的浪潮中,一个常见却棘手的问题浮出水面:如何让AI真正“懂”企业的内部知识?客服机器人面对新产品手册答非所问,技术支持系统对最新政策变更毫无反应——这些并非模型能力…
18、游戏中的控制流操作与Direct3D钩子技术
游戏中的控制流操作与Direct3D钩子技术 1. Adobe AIR模块钩子实现 在游戏开发与调试过程中,有时需要对特定模块的代码进行钩子操作,以监控或修改其行为。这里以Adobe AIR.dll模块为例,介绍如何实现钩子。 1.1 两部分近调用钩子设计 设计了一个两部分的近调用钩子。第一部…
20、游戏透视与视野拓展技巧揭秘
游戏透视与视野拓展技巧揭秘 在游戏世界中,玩家们总是希望能够获得更多的信息和优势,以提升自己的游戏体验和竞技水平。本文将深入探讨几种常见的游戏作弊技巧,包括穿墙透视、变焦透视、抬头显示(HUD)等,以及它们的原理和实现方法。 1. Z缓冲与穿墙透视 在游戏渲染中,…
Kotaemon多路召回策略设计:dense+sparse+colbert
Kotaemon多路召回策略设计:densesparsecolbert 在构建智能问答系统时,我们常常面临一个核心矛盾:大模型虽然能“说”,但未必“知道”。尤其是在企业级场景中,用户的问题往往涉及具体政策、产品条款或专业术语…