Put my job out to experimentally a linear table, the experimental purpose 1. Familiar with the order of linear forms and chain storage structure 2. Master the basic operation of the linear table 3. The calculation of linear table applications can be used to use the basic operation of the linear table
Second, the experimental purpose 1. It is provided with a linear table E = {E1, E2, ..., EN-1, En}, design a algorithm, reverse the linear table, even if the element is arranged in the order, become a reverse linear table E '= {EN, EN- 1, ..., E2, E1}, require the reverse linear table to occupy the original linear table space, and use two methods and single-stranded tables to be done with two programs. (Folder: exercise 9_3)
2. It is known from the linear table indicated by a single-chain table indicated by the head node, contains three types of characters (letters, numbers, and other characters), and the test cells construct three linear tables represented by the circular chain list, so that each Only characters in the table contain the same class, and use the node space in the original table, the head node can also open a space. (Folder: exercise 9_12)
first question
/ * Structure type definition of sequence table. H * /
Typedef char dattype;
/ * const amount = 1024; * /
#define maxSize 1024
Typedef struct
{Datatype Data [MAXSIZE];
Int last;
} sequence;
#include
INT main () {sequence * L; L = Creat (L); PUTS ("Original String: / N"); Print (L); Invert (L); / * Call sequence table inverse value function * / PUTS ("String: / n"); Print (L); System ("Pause");} / * Output Sequence Meter .h * / # include
Void print (sequence * L) {INT i; for (i = 0; i
/ * Establish a sequence table. H * / # include "Sequence Table Structure Type Definition .h" #include
// Second question / * Single-link table structure type definition. H * / typef char Dattype; typef struct node {datatype data; struct node * next;} linklist; / * Single-lapse list inverse primary file .cpp * / # include < Stdafx.h> #include