Home > Back-end >  Sequence table is used to implement the management of the medical record information and the query f
Sequence table is used to implement the management of the medical record information and the query f

Time:10-06

Specific requirements are as follows:
1. The use of teaching materials are defined in the order sheet type storage patient record information (case number, name, symptom); Requires the use of header files,
Table 2. The design sequence locating algorithm, write a function to complete the functions as follows: to look for in the linear table L data element x, if there is a linear table and returns the x value equal to the first serial number of data elements; If not, it returns 1,
Function is defined as an int ListFind (SequenceList L, char * x)
Please test to find whether there is a name in the main function for the patients with x, according to the serial number of the return to print out the patient information,
The following is a header file SequenceList. H
#include
# define MaxSize 100
Typedef struct {
ElemType list [MaxSize];
int size;
} SequenceList;
Void ListInitialize (SequenceList * L)
{
L - & gt; Size=0;
}
Int ListLength SequenceList (L)
{
Return L.s considering;
}
Int ListInsert (SequenceList * L, int I ElemType x)
{
Int j;
If (L - & gt; Size>=MaxSize)
{
Printf (" order table was unable to look up into the full! \n");
return 0;
}
Else if (i<0 | | i> L - & gt; The size)
{
Printf (" parameter I illegal! \n");
return 0;
}
The else {
For (j=L - & gt; The size; J> i; J -)
L - & gt; The list [j]=L - & gt; List] [j - 1;
L - & gt; The list [I]=x;
L - & gt; Size++;
return 1;
}

}
Int ListDelete (SequenceList * L, int I ElemType * x)
{
Int j;
If (L - & gt; Size<=0) {
Printf (" countless according to sequence table has been empty elements can be deleted! \n");
return 0;
}
Else if (i<0 | | i> L - & gt; The size 1) {
Printf (" parameter I illegal ");
return 0;
}
The else {
* x=L - & gt; The list [I];
For (j=I + 1; j<=L - & gt; Size - 1; J++)
L - & gt; List] [j - 1=L - & gt; The list [j];
L - & gt; Size -;
return 1;
}
}
Int ListGet (int I SequenceList L, ElemType * x)
{
If (i<0 | | i> L.s considering 1) {
Printf (" parameter I illegal ");
return 0;
}
The else {
* x=L.l ist [I];
return 1;
}
}

CodePudding user response:

I want to do? I can't see how the main function,
  • Related