码迷,mamicode.com
首页 > 其他好文 > 详细

数据结构的线性表定义

时间:2019-10-09 19:40:02      阅读:111      评论:0      收藏:0      [点我收藏+]

标签:init   length   数据   list   type   typedef   eof   int   lis   

数组静态分配:

#define Maxsize 50

typedef struct{

  Elemtype data[Maxsize];

  int length;  

}SqList;

数组的动态分配:

#define Maxsize 50

typedef struct{

  ElemType *data;

  int length;

}SqList;

动态分配语句:

c:

L.data = (Elemtype*)malloc(sizeof(ElemType)*InitSize);

c++: 

L.data = new ElemType[InitSize];

  

数据结构的线性表定义

标签:init   length   数据   list   type   typedef   eof   int   lis   

原文地址:https://www.cnblogs.com/1999dyq/p/11643396.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!