L.elem=(ElemType*)malloc(LIST-INIT-SIZE*si都zeof(ElemType)) 这句话如何理解最好的话可以把各个英文单词的含义给说明一下,感激不尽!

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/29 11:42:12

L.elem=(ElemType*)malloc(LIST-INIT-SIZE*si都zeof(ElemType)) 这句话如何理解最好的话可以把各个英文单词的含义给说明一下,感激不尽!
L.elem=(ElemType*)malloc(LIST-INIT-SIZE*si都zeof(ElemType)) 这句话如何理解
最好的话可以把各个英文单词的含义给说明一下,感激不尽!

L.elem=(ElemType*)malloc(LIST-INIT-SIZE*si都zeof(ElemType)) 这句话如何理解最好的话可以把各个英文单词的含义给说明一下,感激不尽!
这好像是《数据结构(C语言版)》里面介绍的线性表.
这里是某种数据结构,就假设这是一个线性表,它储存的元素的数据类型为ElemType(就像整型,浮点型,或者是自定义型等等),表长为LIST-INIT-SIZE,L是一个线性表,L的elem成员是这个线性表的首元素的地址.
这个表达式的意思就是分配一个长度为LIST-INIT-SIZE个ElemType长度的空间并强制转换为ElemType类型的指针,将该指针的地址赋给L.elem.这样L就是一个已经分配过空间的线性表了,它已经有了一个空的存储空间,可以放LIST-INIT-SIZE个ElemType类型的数据.

数据结构中有这样语句 L->elem=(ElemType )malloc(LIST_INIT_SIZE*size of(ElemType)); 这是什么意思? 具数据结构中有这样语句L->elem=(ElemType )malloc(LIST_INIT_SIZE*size of(ElemType)); 这是什么意思?具体的含义 求一段数据结构算法分析 看不懂哇int LocateElem_Sq(SqList,ElemType e,Status(*compare)(ElemType,ElemType))i=1;p=L.elem;while(i L是什么,结构体吗,L.elem又是啥 还有L.length,typedef struct{int *elem;int length;int listsize;}SqList;int InitList_Sq(SqList &L){L.elem=(ElemType*)malloc(LIST_INIT_SIZE*sizeof(ElemType));if(!L.elem) return ERROR;L.length=0;L.listsize=LIST_I L.elem=(ElemType*)malloc(LIST-INIT-SIZE*si都zeof(ElemType)) 这句话如何理解最好的话可以把各个英文单词的含义给说明一下,感激不尽! 关于线性表删除数据元素的算法Status listdelete_sq(sqlist &L,int I,elemtype &e){If ((iL.length)) return error;p=&(L.elem[i-1]);e=*p;q=L.elem+L.length-1;for(++p;p for (p=&L.elem[L.length-1]; p>=q; --p)请帮忙解释这个括号里的含义.int Insert_SqList (SqList&L,int i,ElemType x){ if(i< 1 || i>L.length+1) return ERROR; if(L.length>=L.listsize) return OVERFLOW; q=&(L.elem[i-1]); 在下面程序中STATUS ListInsert(List *L,int i,ElemType e) {struct STU *p,*q; if (iL->length+1) return ERROR; q=&(L->elem[i-1]); for(p=&L->elem[L->length-1];p>=q;--p) *(p+1)=*p; *q=e; ++L->length; return OK; }/*ListInsert Before i */这是数据 q=L.elem+L.length-1和q=&L.elem[L.length-1]为什么一样?L. l.elem是什么意思? q=L.elem+L.length; q指向顺序表尾 L.elem和L.length分别是什么东西 数据结构中q=&(L.elem[i-1])是什么意思? 设顺序表L是一个递增有序表,阅读下列程序写出算法功能void demo1(SQLIST *L,int x){ int i;if (L->length>=listsize) return error;i=L->length-1;while(i>=0&&L->elem[i]>x){ L->elem[i+1]=L->elem[i]; i--; }L->elem[i+1]=x;L->length++;} 数据结构中,L.(*elem[i])=2;这样表达对吗?其中SqList L; 链表中LinkList L与LinkList *L的区别以及(*L).elem,L.elem L->next,(*L)->next的区别 void Createlist(linklist (*& L),elemtype a[],int n) //jianli shunxu lianbiao {linklist *s,*r;int i;void Createlist(linklist (*& L),elemtype a[],int n) //jianli shunxu lianbiao{linklist *s,*r;int i;L=(linklist *)malloc(sizeof(linklist)) //chuangjianto LinkList search(LinkList *L, ElemType x) 请问这就话的LinkList和ElemType是什么意思 S_TBL是什么顺序存储结构定义 typedef struct { ElemType *elem; // 数组基址 int length; // 表长度 }S_TBL;把A定义为B是什么意思 线性表中元素后移,for(p=&(L.elem[L.length-1]); p>=q; --p)为什么是--p?而不是++p?