By this practice, understand the creation of the list of the list of the list of sequence tables
// Sequence table Convert into a list, March 16, 2006, Pan An Song Yu #include #define list_init_size 100typedef struct {Int * elem; int layth; int listsize;} sqlist; typef struct lnode { INT DATA; LNODE * NEXT;} lnot, * linklist; int initlist (sqlist & l) {l.elem = new int [list_init_size]; if (! L.Elem) Return 0; L.LENGTH = 0; l.ListSize = List_init_size; returnit 1;} int initlistn (SQList & l, int N) {initlist (l); cout << "input the sqlist" << endl; for (int i = 0; i > L. Elem [i]; l.ley "} returnit 1;}
Void SQTL (Sqlist L, Linklist & S) {LNODE * P, * Q; S = New Lnode; S-> Next = NULL; Q = S; For (INT i = 0; i Data = L.Elem [i]; p-> next = NULL; Q-> Next = P; Q = P;}} void print (Linklist s) {linkList P = S-> Next WHILE (P) {cout << p-> data << ''; p = p-> next;} cout << Endl;} void main () {int N; sqlist l; linklist p; cout << " Input the number: "; cin >> n; initlistn (l, n); SQTL (L, P); Print (P);}