realheapsort_step2.c

loading
details
attribute value
description
owner Johannes Waldmann
uploaded 2017-08-17 03:45:23.0
disk size 694 Bytes
downloadable true
type
attribute value
name no_type
processor id 1
description this is the default benchmark type for rejected benchmarks and benchmarks that are not associated with a type.
owning community none
loading contents
int nondet();

//realheapsort - destruction only
//aspic - delay 3 nécessaire, et pas de -nomu dans rank
// on trouve 
void realheapsort_step2(int N)
{
  //int t[100];
  int temp;
  int k,j,m;
  if(N > 2){
  //destruction
  
    for (k=0;k<=N-2;k++)
      {
        j = 0; m=0;
        temp =nondet();// t[N-k-1];
        ;//t[N-k-1]=t[0];
        ;//t[0]=temp;
        while(2*j+1<=N-2-k)
	  {
	    if ((2*j+1==N-2-k) || (nondet()<nondet()))
	      m=2*j+1;
	    else
	      m=2*j+2;
            if (nondet()>nondet())
	      {//swap j m
	        temp=nondet();//t[m];
	        ;//t[m]=t[j];
            ;//t[j]=temp;
	        j=m;
	      }
            else j=N;
	  
	  }
	
      }
  }
}
  
popout

content may be truncated. 'popout' for larger text window.

actions get anonymous link download benchmark