摘要: #include<iostream>#include<string>using namespace std;#define LIST_INIT_SIZE 100#define LISTINCREMENT 10typedef int Status,ElemType;typedef struct{ ElemType *elem; int length; int listsize;}SqList;void Init_Sq(SqList &L){ L.elem=new ElemType[LIST_INIT_SIZE]; if(L.elem==NULL) exit(1); 阅读全文
posted @ 2012-09-26 23:14 ♂咱說 ろ算 阅读(209) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>using namespace std;typedef int ElemType;typedef struct List{ ElemType data; struct List *next;}LinkNode,*LinkList;LinkNode *creat_List(int number){ LinkList first=new LinkNode; first->data=-1; LinkList p=first; if(first==NULL) { cout<<"分配内存失败"<<endl; 阅读全文
posted @ 2012-09-26 23:13 ♂咱說 ろ算 阅读(259) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>using namespace std;typedef int ElemType;typedef struct Node{ ElemType data; Node *next,*prior;}LinkNode,*LinkList;void creat_List(LinkList&L,int length){ LinkNode *p,*first=L; while(length-->0) { p=new LinkNode; cin>>p->data; L->next=p; p->prior=L; L=p; 阅读全文
posted @ 2012-09-26 23:12 ♂咱說 ろ算 阅读(153) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>using namespace std;typedef int ElemType ;typedef struct node{ElemType data;struct node *next;}LinkNode,*LinkList;void creat(LinkList&first,LinkNode*&last,int endTage)//递归尾插法建立链表{ElemType data;cout<<"请建立数据"<<endl;cin>>data;if(endTage==data) 阅读全文
posted @ 2012-09-26 23:10 ♂咱說 ろ算 阅读(240) 评论(0) 推荐(0) 编辑