• LF몰 이벤트
  • 파일시티 이벤트
  • 서울좀비 이벤트
  • 탑툰 이벤트
  • 닥터피엘 이벤트
  • 아이템베이 이벤트
  • 아이템매니아 이벤트

광운대 알고리즘 Quick sort, best case, worst case, 시간복잡도 및 분석 레포트

*예*
개인인증판매자스토어
최초 등록일
2020.03.26
최종 저작일
2019.04
12페이지/파일확장자 압축파일
가격 6,500원 할인쿠폰받기
다운로드
장바구니

소개글

과제할때 참고하시면 좋을것 같습니다
Quick sort에 대한 best case, worst case 시간 복잡도 분석 레포트입니다
각각 case에 대한 증명, 실제 코드 돌렸을때 측정된 시간그래프, 코드 증명 등 작성했습니다
과제 점수 모두 만점 받았습니다
코드(c++)와 레포트 모두 있습니다
(광운대 알고리즘 2차 과제)

목차

1. To show the results and graphs in Problems 2, 3, and 4, write your program with your comments. Explain your program at least four lines.

2. When you run your program for the following cases, show the step-by-step results. Explain the results at least four lines.
(a) For the worst-case time complexity of quicksort
(b) For the best-case time complexity of quicksort
(c) For the average-case time complexity of randomized quicksort

3 - (a) For the worst-case time complexity of quicksort
3 - (b) For the best-case time complexity of quicksort
3 - (c) For the average-case time complexity of randomized quicksort

4. When you run your program for the following cases, draw the graphs for the actual running time in your PC versus n. Write the basic information about the PC (e.g., CPU, RAM, OS). Explain the graphs at least four lines.
(a) For the worst-case time complexity of quicksort
(b) For the best-case time complexity of quicksort
(c) For the average-case time complexity of randomized quicksort

본문내용

1. To show the results and graphs in Problems 2, 3, and 4, write your program with your comments. Explain your program at least four lines.
void swap(int arr[ ], int a, int b) {
int temp = arr[a];
arr[a] = arr[b];
arr[b] = temp;
}

int partition(int arr[ ], int p, int q) {
int pivot = arr[p]; //시작을 pivot으로
int i = p;
for (int j = p + 1; j <= q; j++) {
if (arr[j] <= pivot) {
i++;
swap(arr, j, i);
}
}
swap(arr, p, i);
return i; // 중간위치 반환

void quick(int arr[ ], int p, int r) {
if (p < r) {
int q = partition(arr, p, r);
quick(arr, p, q - 1);
quick(arr, q + 1, r);
}
}

int main() {
int arr[ ] = { 3,2,4,5,2,1 };
int n = (sizeof(arr) / sizeof(int))-1;
quick(arr, 0, n);
for (int i = 0; i < n+1; i++) {
printf("%d", arr[i]);
}
printf("\n");
return 0;
}

Quick sort는 pivot값을 중심으로 subarray를 2개로 나눠서 진행하는 것이다. Pivot 값을 중심으로 왼쪽에 위치하는 값들은 pivot보다 작게, 오른쪽은 pivot보다 크게 정렬한다. 2개의 subarray를 재귀적으로 sort하는 것이다.

참고 자료

없음

압축파일 내 파일목록

알고리즘_2차_보고서.docx
코드/소스.cpp
*예*
판매자 유형Bronze개인인증

주의사항

저작권 자료의 정보 및 내용의 진실성에 대하여 해피캠퍼스는 보증하지 않으며, 해당 정보 및 게시물 저작권과 기타 법적 책임은 자료 등록자에게 있습니다.
자료 및 게시물 내용의 불법적 이용, 무단 전재∙배포는 금지되어 있습니다.
저작권침해, 명예훼손 등 분쟁 요소 발견 시 고객센터의 저작권침해 신고센터를 이용해 주시기 바랍니다.
환불정책

해피캠퍼스는 구매자와 판매자 모두가 만족하는 서비스가 되도록 노력하고 있으며, 아래의 4가지 자료환불 조건을 꼭 확인해주시기 바랍니다.

파일오류 중복자료 저작권 없음 설명과 실제 내용 불일치
파일의 다운로드가 제대로 되지 않거나 파일형식에 맞는 프로그램으로 정상 작동하지 않는 경우 다른 자료와 70% 이상 내용이 일치하는 경우 (중복임을 확인할 수 있는 근거 필요함) 인터넷의 다른 사이트, 연구기관, 학교, 서적 등의 자료를 도용한 경우 자료의 설명과 실제 자료의 내용이 일치하지 않는 경우

이런 노하우도 있어요!더보기

최근 본 자료더보기
탑툰 이벤트
광운대 알고리즘 Quick sort, best case, worst case, 시간복잡도 및 분석 레포트
  • 레이어 팝업
  • 레이어 팝업
  • 레이어 팝업
  • 레이어 팝업
  • 레이어 팝업