数据结构.线性插入问题.For(p=&(L.elem[L.length-1]);p>=q;——p)*(p+1)=*p;我怎么感觉——p.也可以写成p——;改了有影响吗?

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/06 02:09:17
数据结构.线性插入问题.For(p=&(L.elem[L.length-1]);p>=q;——p)*(p+1)=*p;我怎么感觉——p.也可以写成p——;改了有影响吗?

数据结构.线性插入问题.For(p=&(L.elem[L.length-1]);p>=q;——p)*(p+1)=*p;我怎么感觉——p.也可以写成p——;改了有影响吗?
数据结构.线性插入问题.
For(p=&(L.elem[L.length-1]);p>=q;——p)
*(p+1)=*p;
我怎么感觉——p.也可以写成p——;改了有影响吗?

数据结构.线性插入问题.For(p=&(L.elem[L.length-1]);p>=q;——p)*(p+1)=*p;我怎么感觉——p.也可以写成p——;改了有影响吗?
还是不明白楼主的问题,看楼主的代码没有主函数啊!根据你的代码给你写了个主函数,创建链表和输出链表都能运行.希望楼主具体说明一下你的问题
#include #include #define overflow -1#define ok 1#define error 0#define listinitsize 50#define listincrement 10typedef int status;typedef int elemtype; typedef struct lnode{ elemtype data; struct lnode *next; }lnode, *linklist;status lnitlist_l(linklist &l) //构造一个空的线性链表L{ l= (linklist)malloc(sizeof(lnode)); l->next=NULL; return ok;}//InitList_lstatus createlist_l(linklist &l){ int i,n; linklist p,q; l = (linklist)malloc(sizeof(lnode)); l->next = NULL; printf("please intput the length of the linklist:");\x09 scanf("%d",&n); printf("please intput the date of the linklist:"); p=l; for(i = 0; i < n; ++i) { q = (linklist)malloc(sizeof(lnode)); scanf("%d",&q->data); q->next=NULL; p->next=q; p =q; } return ok;}//建表 status listlength_l(linklist l){ linklist p=l; elemtype i=0; while (p->next) {p=p->next;i++;} return(i);}//求表长 status output_l(linklist l){\x09int i;\x09printf("the length of the lingklist:%d\n",listlength_l(l));\x09printf("the data of the linklist:"); linklist p; p = l->next; while(p) { printf("%d ",p->data); p = p->next; } printf("\n");\x09return ok;\x09}void main(){\x09linklist head;\x09createlist_l(head); //创建链表\x09output_l(head); //输出链表}

数据结构.线性插入问题.For(p=&(L.elem[L.length-1]);p>=q;——p)*(p+1)=*p;我怎么感觉——p.也可以写成p——;改了有影响吗? 数据结构 线性表 for(++p;p 有关于数据结构线性表的一些问题9.若要在一个不带头结点的单链表的首结点*p结点之前插入一个*s结点时,可执行下列操作:s->next=_____________; p->next=s; t=p->data; p->data= _____________; s->data=________ 数据结构中:s->next=p->next;p->next=s.怎么解释.假设线性表里有两个数据元素a和b,要在a和b之间插入一个x,已知p为指向a的指针,那应该怎么写?书上写的是:s->next=p->next;p->next=s.我想问的是第一句我 数据结构问题,关于队列的.Status EnQueue(LinkQueue &Q,QElemType e)//插入元素e为列队Q的新队尾元素 { p=(QueuePtr)mallco(sizeof(QNode));if(!p) exit(OVERFLOW);p->data=e;p->next=NULL;Q.rear->Next=p;Q.rear=p;return OK;}其中的if(!p) 数据结构中,在两节点之间插入一节点,s->next=p->next; p->next=s;p->next=s;中的s什么意思? 数据结构的小问题 p->prior->next=p->next和p->next->prior=p->prior是什么意思? 数据结构,计算语句频度问题k=0;for(i=1;i 数据结构题目:双链表中,在*p结点之后插入一个结点*s的操作是?双链表中,在*p结点之后插入一个结点*s的操作是( )A.s->prior=p;p->next=s;p->next->prior=s;s->next=p->next;B.s->next=p->next;p->next->prior=s;p->nex 数据结构中队列和指针的一个问题for(p=&Q.front,q=&Q.rear;*p!=*q&&total>m;p++){ //p,q为指针Dequeue(Q,ee);//(1)……//(2)}如上,我想用p指到队首,q指到对尾,然后进行了(1)的操作,Q.front就变了,那p的指 数据结构里!p || if ( p || j > i - 1 ) return ERROR单链表插入算法里面的一句, 数据结构的问题:s=p->next 的意思是什么,s有的是一个指针还是内容或者都有? 在数据结构中 LinkList *p=L->next;While(p! 一道数据结构题目.已知闭散列表的长度为10(散列地址空间为0..9),散列函数为H(K)=K%8,采用线性重新散列技术解决冲突.将下一组数据{25,16,38,47,79,82,51,39}依次插入到散列表中,请画出插入 以下数据结构中 哪一个是线性结构 数据结构C语言版 帮忙解释下(怎么感觉答案每个都对) 1.在循环双链表的p所指结点之后插入s所指结点的操作是_____.A.p->right=s; s->left=p; p->right->left=s; s=->right=p->right;B.p->right=s; p->right->left=s; s- 数据结构括号匹配问题? 数据结构 图 问题