数据结构
mycomputerxiaomei
这个作者很懒,什么都没留下…
展开
-
对顺序表的部分操作(2)
/*功能为:删除顺序表中范围为[x,y]之间所有元素值,要求时间复杂度为O(n),空间复杂度为O(1)*/ void DeleElemRange(Sqlist *&L,ElemType x,ElemType y) { int i=0,j=0; while(ilength) { if(!(L->data[i]>=x&&L->data[i] { L->data[j]原创 2012-08-25 20:34:47 · 528 阅读 · 0 评论 -
对顺序表的操作完整程序(1)
#include #include /**********带头结点的顺序链表******************/ #define MaxSize 50 typedef int ElemType; typedef struct { ElemType data[MaxSize]; int length; }Sqlist; /*******************创建原创 2012-08-25 16:10:52 · 924 阅读 · 0 评论 -
对线性链表的完整操作(1)
#include #include #define MaxSize 50 typedef int ElemType; /////////////////////////////////////////// typedef struct LNode { ElemType data; struct LNode *next; }LinkList; //单链表结点类型 /***原创 2012-08-25 20:40:19 · 618 阅读 · 0 评论