올린글을 확인할 수 있도록 포스팅을 공개로 설정해 주세요.
b[0]. col=a[0]. row;
row-terms[a[i]. col] ++;//Arow-terms1
j=starting-pos[a[i]. col] ++;
b [j]. row=a[i]. col;
b [j]. col=a[i]. row;
printf("a[%d] |%d||", i, arr[i]);
printf("row-terms[%d]|%d||", i, cou nt[i]) ;//
a[i]= B[i+1].value;

Fastt ranspos e의 row-terms 배열에 a의 항목들의 개수를 채워넣고, 이를 이용하여 starting-pos 배열을 계산한다.
c 이와 같은 방식으로 계속 진행하면 a배열의 항목들이 sorted 배열에 정렬되게 된다.
위와 같은 정렬 방식을 Cou ntingSort 라 한다
introw-terms[MAX];
b[0]. row=num-col;
b[0].value=num-terms;
for(i=0; i printf("row-terms[%d]= % d\n", i, row-terms[i]);
starting-pos[i]=starting-pos [i-1]+row-terms[i-1];
printf("starting-pos[%d]= % d\n", i, starting-pos [i]);
j=starting-pos[a[i]. col] ++;
printf("j=% 2d=starting-pos[a[%2d]. col] ++=starting-pos[%d]++\n", j, i, a[i]. col);
b [j]. row=a[i]. col;
printf("a[%d] |%d||", i, arr[i]);
intval=ar r[i];
printf("row-terms[%d]|%d||", i, cou nt[i]) ;//
printf("%d|", i);
A[0]. col=101;A[0]. row=101;A[0].value=100;
A[i]. col=i; A[i]. row=i; A[i].value=(rand()% 100);
a[i]= B[i+1].value;

[hwp/pdf]counting정렬 3
포스팅 주소 입력
  올린글을 확인할 수 있는 포스팅 주소를 입력해 주세요.
  네이버,다음,티스토리,스팀잇,페이스북,레딧,기타 등 각각 4개(20,000p) 까지 등록 가능하며 총 80,000p(8,000원)까지 적립이 가능합니다.