Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
359 B
4
Indexable
Never
void Psort(process PList[])
{
    bool swapped=false;
    int i = 0;
    while (true)
    {
	swap=false;
    	for (int i = 0; i<n-1; i++)
    	{
		if(PList[i].arv > PList[i+1].arv)
		{
			process temp = PList[i];
             		PList[i] = PList[i+1];
			PList[i+1] = temp;
			swapped = true;
		}

	}
	if (swapp==false)
		return;
    }		
}