자기 자신을 호출하는 재귀 함수. 이 기본적인 컴퓨터 과학 개념은 문제 해결을 위한 분할 정복
전략의 기초를 구성한다.
●
병합 정렬과 퀵 정렬이 분할 정복을 사용해
O
(
N
log
N
)의 성능으로 요소가
N
개인 배열을 정렬
하는 방법. 힙 정렬도
O
(
N
log
N
)을 보장하는 방법
●
팀 정렬이 삽입 정렬과 병합 정렬의 기능을 결합해,
O
(
N
log
N
) 성능을 보장하는 파이썬의 기
본 정렬 알고리즘을 구현하는 방법
이 장에서는 배열의
N
개 요소를 오름차순으로 재배열하는 알고리즘을 소개한다. 값의 컬렉션
을 정렬된 순서로 구성하는 작업은 프로그램의 효율성을 향상하는 데 필수다. 또한 정렬은 여
1
예를 들면 정수나 문자열을 내림차순으로 정렬하거나, 기본 순서가 없는
2
차원 (
x
,
y
) 좌표 모음을 정렬하는 데 사용한다.
정렬
CHAPTER
5
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.
O’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
I wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
I’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
I'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.