随笔分类 - 数据结构之链表
摘要:#include<iostream>#include<malloc.h>#include<stdlib.h>#include<stdio.h>using namespace std;typedef struct node{ float xs; int zs; struct node *next; }
阅读全文
摘要:#include<iostream>#include<malloc.h>#include<stdlib.h>#include<stdio.h>using namespace std; typedef struct node{ char data; struct node *prior; struct
阅读全文
摘要:#include<iostream>#include<malloc.h>#include<string.h>#include<stdio.h>using namespace std;#define maxsize 100typedef struct node{ int data; struct no
阅读全文
摘要:#include<iostream>#include<malloc.h>#include<string.h>#include<stdio.h>using namespace std;#define maxsize 100typedef struct node{ int data; struct no
阅读全文
摘要://尽量多声名几个指针 避免使用到 头节点 还有 /* 第一点 :初始化和建造链表放在一起了 且返回值用linklist类型 第二点:多项式相加是本质是链表的交集 交集需要注意的是(比较指数大小 小的放在新链表上 指针后移 如果那个表空了直接把 剩下的链到新链表) #include<stdio.h>
阅读全文
摘要://说实话我把差集想的太复杂了 考虑了许多没用的 //最后却用了一种简单的方法解决了 #include<stdio.h>#include<malloc.h>#include<stdlib.h>typedef struct node{ //char data;// int count; int dat
阅读全文
摘要:/* 总结:就是建立一个循环单链表,再按循环取余删除节点: 注意:1.未给指针变量s分配动态内存时,让其等于别的分配内存的指针(q)相当于 把 s指向其内存,并不能建立链接。 2.此链表带头节点 遇到问题 :1.在选择人的时候遇到了阻碍(不知如何选) 2.设置头节点,循环(难点) */#includ
阅读全文
摘要:/*先看看单链表的知识很快就能做出来 这个用三个结构体指针,两个p1,p2指向建立的链表,一个p3指向新的链表判断判断p1p2指向的数据那个小,小的赋值给p3->next(升序),小的那个p1(p2)下移一个赋值顺序要搞对,要不然指向有误 */ #include<stdlib.h>#include<
阅读全文
摘要:链表中LinkList L与LinkList *L的区别以及(*L).elem,L.elem L->next,(*L)->next的区别typedef struct Node{int elem;struct node * next;}node,*LinkList; 对于LinkList L: L是指
阅读全文
摘要:我去终于做出来了 不是难 是前面的东西学的不扎实导致有的东西理解的不到位 又恶补了一下 终于做出来了 世上无难事,只怕有心人。光改错就好几就 想放弃的时候 想一想问什么别人可以做出来 你为什么不行。。。多琢磨下 画画图 估计每个学过c语言的同学都可以做出来 #include<stdio.h>#inc
阅读全文
摘要://没啥说的 挺简单 //2.2.1 #include<stdio.h> #include<stdlib.h> #include<malloc.h> #define maxsize 100 typedef struct { int list[maxsize]; int last; int len;
阅读全文
posted @ 2016-09-07 03:45
mykonons

浙公网安备 33010602011771号