对文章的字母个数,关键字个数进行统计,浏览文章,删除特定字符串,输入文章等进行管理,采用链表实现.
上传时间: 2014-01-21
上传用户:dyctj
异质链表,可输入整数,浮点数,字符串。可进行遍历,逆置,删除头节点,删除尾节点,清空链表。
标签: 链表
上传时间: 2015-03-29
上传用户:1106132595
两个链表的交集 #include<stdio.h> #include<stdlib.h> typedef struct Node{ int data; struct Node *next; }Node; void initpointer(struct Node *p){ p=NULL; } int printlist(struct Node* head){ int flag=1; head=head->next; /* 因为标记1的地方你用了头结点,所以第一个数据域无效,应该从下一个头元结点开始 */ if(head==NULL) printf("NULL\n"); else { while(head!=NULL) { if(flag==1) { printf("%d",head->data); flag=0; } else { printf(" %d",head->data); } head=head->next; } printf("\n"); } return 0; } struct Node *creatlist(struct Node *head) { int n; struct Node *p1=(struct Node *)malloc(sizeof(struct Node)); p1->next=NULL; while(scanf("%d",&n),n!=-1) { struct Node *pnode=(struct Node *)malloc(sizeof(struct Node)); pnode->next=NULL; pnode->data=n; if(head==NULL) head=pnode; p1->next=pnode; p1=pnode; } return head; } struct Node *Intersect(struct Node *head1, struct Node *head2) { struct Node *p1=head1,*p2=head2;/*我这里没有用头指针和头结点,这里是首元结点head1里面就是第一个数据,一定要理解什么事头指针, 头结点,和首元结点 具体你一定要看这个博客:http://blog.sina.com.cn/s/blog_71e7e6fb0101lipz.html*/ struct Node *head,*p,*q; head = (struct Node *)malloc(sizeof(struct Node)); head->next = NULL; p = head; while( (p1!=NULL)&&(p2!=NULL) ) { if (p1->data == p2->data) { q = (struct Node *)malloc(sizeof(struct Node)); q->data = p1->data; q->next = NULL; p->next = q;//我可以认为你这里用了头结点,也就是说第一个数据域无效 **标记1** p = q; p1 = p1->next; p2 = p2->next; } else if (p1->data < p2->data) { p1 = p1->next; } else { p2 = p2->next; } } return head; } int main() { struct Node *head=NULL,*headt=NULL,*t; //initpointer(head);//这里的函数相当于head=NULL; // initpointer(headt);//上面已经写了headt=NULL那么这里可以不用调用这个函数 head=creatlist(head); headt=creatlist(headt); t=Intersect(head,headt); printlist(t); }
标签: c语言编程
上传时间: 2015-04-27
上传用户:coco2017co
自己用C++写的一个链表类,节点数据域可以存储任何数据类型
标签: C/C++
上传时间: 2015-05-14
上传用户:mxs1234
用C++语言实现单向链表。并使用模板类的实现方式。使用了控制台的方式。
上传时间: 2016-01-13
上传用户:YANG123
循环链表是另一种形式的链式存贮结构。它的特点是表中最后一个结点的指针域指向头结点,整个链表形成一个环。
标签: 循环
上传时间: 2016-05-01
上传用户:hornet
基于C语言链表的学生管理系统 期末作业 课程设计
上传时间: 2016-06-09
上传用户:a6942318
用链表实现学生成绩管理系统 用于课程设计 期末作业
标签: 管理系统
上传时间: 2016-06-09
上传用户:a6942318
(1)随机产生或者创建一组元素序列,,建立一个带头结点的单向链表(无序) (2)遍历单向链表(显示顺序表) (3)把单向链表中元素逆置(不允许申请新的结点空间) (4)在单向链表中删除所有的偶数元素结点 (5)实现将单项链表分成两个链表,其中一个全部一样为奇数,另外一个全部为偶数(尽量利用已知的结点空间)
上传时间: 2016-11-29
上传用户:dahaoren
c++-学生信息管理系统-(链表+文件)--实验报告
上传时间: 2017-01-02
上传用户:972913434@qq.com