javascript.co.kr 알고리즘(버블정렬, 퀵정렬, 쉬트라센) > javascript2 | javascript.co.kr report

알고리즘(버블정렬, 퀵정렬, 쉬트라센) > javascript2

본문 바로가기

뒤로가기 javascript2

알고리즘(버블정렬, 퀵정렬, 쉬트라센)

페이지 정보

작성일 19-05-24 14:38

본문




Download : 알고리즘(버블정렬, 퀵정렬, 쉬트라센).hwp




알고리즘(버블정렬, 퀵정렬, 쉬트라센) , 알고리즘(버블정렬, 퀵정렬, 쉬트라센)기타레포트 , 알고리즘 버블정렬 퀵정렬 쉬트라센
순서


알고리즘,버블정렬,퀵정렬,쉬트라센,기타,레포트

Download : 알고리즘(버블정렬, 퀵정렬, 쉬트라센).hwp( 43 )



bubble sort

#include `stdio.h`
#include `stdlib.h`
#include `time.h`

#define TRUE 1
#define FALSE 0

void swap(int a, int b){
int tmp=a;
a=b;
b=tmp;
}

void bubble_sort(int array){
int i,j;
int isSwaped;

for(i=0; i`999; i++){
isSwaped=FALSE;
for(j=0; j`999-i; j++){
if(array[j]`array[j+1]){
swap(&array[j],&array[j+1]);
isSwaped=TRUE;
}
}
if(isSwapedFALSE) {
break
}
}

for(i=0; i`1000; i++){
printf(`%4dn`,array[i]);
}
}
clock_t start,end;
int main(void){
int array[1000];
clock_t start,end;
srand(time(NULL));
int i;
for(i=0; i`1000; i++){
array[i]=rand()%1000;
}
start = clock();
bubble_sort(array);
end = clock();
printf(`%f`, ((double)end-start)/CLK_TCK);
return 0;
}

각각 배열 값 1000, 5000, 10000개 일 때 처리 시간

quick sort

#include `stdio.h`
#…(省略)

레포트/기타
알고리즘(버블정렬, 퀵정렬, 쉬트라센)

알고리즘(버블정렬,%20퀵정렬,%20쉬트라센)_hwp_01.gif 알고리즘(버블정렬,%20퀵정렬,%20쉬트라센)_hwp_02.gif 알고리즘(버블정렬,%20퀵정렬,%20쉬트라센)_hwp_03.gif 알고리즘(버블정렬,%20퀵정렬,%20쉬트라센)_hwp_04.gif 알고리즘(버블정렬,%20퀵정렬,%20쉬트라센)_hwp_05.gif 알고리즘(버블정렬,%20퀵정렬,%20쉬트라센)_hwp_06.gif









알고리즘(버블정렬, 퀵정렬, 쉬트라센)


설명

다.
전체 22,447건 1 페이지
해당자료의 저작권은 각 업로더에게 있습니다.

evga.co.kr 은 통신판매중개자이며 통신판매의 당사자가 아닙니다.
따라서 상품·거래정보 및 거래에 대하여 책임을 지지 않습니다.
Copyright © javascript.co.kr. All rights reserved.
PC 버전으로 보기