소팅 알고리즘(sorting algorithm) 구현 및 분석
닫기
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
해당 자료는 10페이지 까지만 미리보기를 제공합니다.
10페이지 이후부터 다운로드 후 확인할 수 있습니다.

소개글

소팅 알고리즘(sorting algorithm) 구현 및 분석에 대한 보고서 자료입니다.

목차

소스코드 포함

1. 프로그램 디자인

2. 주요 소스 코드 설명

3. 알고리즘 분석

4. 실행화면

본문내용

보고서 일부서 발췌

1) bubble sort
#define SWAP(x, y, t) ( (t)=(x), (x)=(y), (y)=(t) )
void bubbleSort(int list[], int n)
{
int i, j, temp;
for(i=n-1; i>0; i--){
for(j=0; j /* 앞뒤의레코드를비교한후교체*/
if(list[j]>list[j+1])
SWAP(list[j], list[j+1], temp);
}
}
2) insertion sort
void insertionSort(int list[], int n)
{
int i, j;
int key;
for(i=1; i key = list[i];
for(j=i-1; j>=0 && (list[j]>key) ; j--) //(list[j]>key): ascending order
list[j+1]=list[j];
list[j+1]=key;
}
}

3) heap sort
#define SWAP(x, y, t) ( (t)=(x), (x)=(y), (y)=(t) )
int heap[100000+1];

void adjust(int heap[], int root, int n)
{
int child, temp;
temp = heap[root]; // 루트값저장
child = 2*root; // 왼쪽자식노드
while(child <= n){ // 마지막노드까지반복
if(child child++;
if(temp>heap[child]) // 부모노드와자식노드비교

.......

키워드

  • 가격3,000
  • 페이지수50페이지
  • 등록일2010.01.04
  • 저작시기2009.10
  • 파일형식압축파일(zip)
  • 자료번호#571350
본 자료는 최근 2주간 다운받은 회원이 없습니다.
청소해
다운로드 장바구니