Home > Back-end >  Trouble bosses to explain how this code running ~
Trouble bosses to explain how this code running ~

Time:09-15

Void listbyname ()
{
int i,j,k;
Struct person t;
For (I=1; i {
If (STRCMP (per [I] cName, per [I - 1]. CName) & lt; 0)
{
T=per [I];
J=I - 1;
Do
{
Per [j + 1)=per [j];
J -;
}
While ((STRCMP (tc Name, per [j]. Journal of cName) & lt; 0 & & J & gt;=0));
Per [m + 1]=t;
}
}
Printf (" \ n \ t sort success! Whether show?" );
Printf (" \ n \ t1. Yes 2. No ");
Printf (" please enter a number you choose: ");
The scanf (" % d ", & amp; K);
If (1==k)
Showall ();
return;
}

CodePudding user response:

Declare a structure variable t, and then compare cName, exchange,

CodePudding user response:

Similar to an insertion sort,

CodePudding user response:

Can imagine playing CARDS and get a card, and then to find the location of the insert, insert ~ after find out
  • Related