본문 바로가기

IT

힙소트 // 자세한 설명은 생략한다

void adjust(int a[], int root, int n)

{

int child, rootkey,temp;

temp = a[root];

rootkey = a[root];

child = 2*root;

while(child <= n)

{


}

}


void hsort(int a[], int n)

{

int i,j, temp;


for(i=n/2;i>0;i--)

adjust(a,i,n);

for(i=n-1;i>0;i--)

{

temp = a[1];

a[1] = a[i+1];

a[i+1] = temp;


adjust(a,1,i);

}

}

'IT' 카테고리의 다른 글

이게 뭐지  (0) 2014.05.14
뭔진 잘 모르겠다.  (0) 2014.05.14
머지 소트  (0) 2014.05.14
위너트리하고싶다 . c  (0) 2014.05.14
뭔진 모르지만 그냥 정렬  (0) 2014.05.14