Home > Back-end >  Put orderly array orderly in the queue, including lnitquene for initialization, enquene for into the
Put orderly array orderly in the queue, including lnitquene for initialization, enquene for into the

Time:10-04

Void the insert () {
Squene S;
Qelemtype e;
Lnitquene (S);
,9,0 int a [3]={2};
Int b [3]=,4,2 {1};
Int [3] c=,6,8 {3};

Int I=0, j=0, k=0;
I=j=k=0;
While (I & lt; 3 & amp; & J & lt; 3 & amp; & K & lt; 3)
{
If (a [I] Enquene (S, a [i++]);
Else if (b [j] Enquene [j++] (S, b);
The else
Enquene (S, c [k++]);
}
While (I & lt; 3)
Enquene (S, a [i++]);
While (j & lt; 3)
Enquene [j++] (S, b);
While (k & lt; 3)
Enquene (S, c [k++]);
Printf (" new orderly array is: ");
While (s. ront!=S.r ear)

{
Dequene (S, e);
cout}
cout}

CodePudding user response:

Stick a complete code, the rest of the code by guess?
  • Related