솔

  • 홈
  • 태그
  • 방명록

time complexity 1

QuickSort (퀵정렬)

이번에는 퀵정렬에 대해 알아보겠습니다. 퀵정렬은 배열을 두 부분으로 나누고 다시 합치는 과정에서 병합 정렬과 비슷한 면이 있지만,  배열을 절반으로 자르는 병합 정렬과는 달리 퀵정렬은 pivot 값을 중심으로 배열을 두 개로 나눕니다. 이떄 pivot 값은 어떤 값이 되어도 상관 없습니다. (pivot 값에 따라 시간 복잡도가 달라집니다) -퀵정렬 코드(난수x)int Partition(int* arr, int low, int high, int n) { int pivot = arr[size_t(floorf((high - low) / 2.0f)) + low]; int i = low; int j = high; while (true) { while (arr[i] pivot) j--; if (..

DataStructure/Algorithm 2024.09.16
이전
1
다음
더보기
프로필사진

솔

c++기반 개발 공부기록 블로그입니다.

  • 분류 전체보기 (135)
    • 백준 (39)
      • c (28)
      • 점검 (1)
      • 2024scon (2)
      • c++ (4)
    • DataStructure (23)
      • Algorithm (11)
    • Book (61)
      • COMPUTER ORGANIZATION AND D.. (27)
      • COMPUTER NETWORKING A TOP-D.. (28)
      • Foundations Of Algorithms (4)
      • Concepts of Programming Lan.. (2)
    • R (9)
    • graphics (2)
    • Linux System Programming (0)

Tag

computernetwork, Computer Architecture, 컴퓨터네트워크, 네트워크, Computer, 알고리즘, Algorithm, assembly, binaryTree, c, c++, Computer Network, RISC-V, 백준, 컴퓨터, AVL, network, computer organization, 컴퓨터구조, DataStructure,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

«   2025/08   »
일 월 화 수 목 금 토
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

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

티스토리툴바