# include & lt; String. H>
Using namespace STD.
//Definition of the data element
Struct NBAplayer {
Char name [20].
int height;
int age;
Int Threept;
Int dunk.
Int block;
Int overall;
};
//the Node
The template & lt; The class T>
Struct Node {
T data;//data field
Node
};
//the class declaration
The template & lt; The class T>
The class LinkedList {
Public:
LinkedList ();//None - parameter constructor
LinkedList (T a [], int n);//Constructor.
~ LinkedList () {}//Destructor.
Int Length ();//Return the length of the list
Void the Get (int I);//Search by position
Int the Locate (T, x);//Search by player
Void Insert (int I, T, x);//insert player x to the position I
Void the Delete (int I);//delete the ith player
Void PrintList ();//the output
Private:
Node
};
//the Following are the functions provides of the class
The template & lt; The class T>
LinkedList
The first=new Node
First - & gt; Next=NULL;
}
The template & lt; The class T>
LinkedList
int i;
Node
The first=new Node
//first - & gt; Next=NULL;
for(i=0; i
S - & gt; data=https://bbs.csdn.net/topics/a [I];
S - & gt; Next=first - & gt; Next;
First - & gt; Next=s;
}
}
//
The template & lt; The class T>
Int LinkedList
S=first - & gt; Next; int count=0;
while(p! NULL)
{
P=p - & gt; Next;
count++;
}
return count;
/*
Return length;
*/
}
The template & lt; The class T>
Void LinkedList
S=first - & gt; Next; Int count=1;
While (S! NULL& & Count{
S=S - & gt; Next;
count++;
}
If (S==NULL) throw "weizhifeifa";
The else
Cout & lt; Data [I - 1]. The name & lt; <"' & lt;
If (I & lt; 1 & amp; & I & gt; Length) throw "illegal" find position;
//cout "" means the print
Cout & lt; Data [I - 1]. The name & lt; <"' & lt;
*/
}
The template & lt; The class T>
Int LinkedList
S=first - & gt; Next; Int count=1;
While (S! NULL) {
If (STRCMP (S - & gt; Data [I]. Name, x.n ame)==0) {
//"STRCMP is" means "string compare". If two strings are the same, the function returns 0;
return i+1;
}
}
return 0;
}
The template & lt; The class T>
Void LinkedList
S=first; int count=0;
While (S! NULL& & Count{
S=S - & gt; Next;
count++;
}
If (S==NULL) threw "weizhifeifa";
The else {
P=new Node; P - & gt; The DATE=x;
P - & gt; Next=S - & gt; Next;
S-> Next=p;
}
}
The template & lt; The class T>
NBAplayer LinkedList
S=first; int count=0;
While (S! NULL& & Count{
S=S - & gt; Next;
count++;
}
If (S==NULL | | S - & gt; Next==NULL)
Throw "weizhifeifa";
The else
P=s - & gt; Next; X=p - & gt; data;
S-> Next=p - & gt; Next;
The delete p;
//return x;
}
The template & lt; The class T>
Void LinkedList
S=first - & gt; Next;
While (S! NULL) {
Cout & lt; Data [I - 1]. The name & lt; <"' & lt;
<"' & lt;
}
}
//Above is the complete class
//the main function
Int main () {
NBAplayer X;
Int I, j;
//First, we define three players, and put them in an array
NBAplayer player [3]={
{2.03, "James", 31,60,99,90,95},
{" Harden ", 1.96, 26,80,89,75,90},
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull