Skip to Content
자바로 배우는 핵심 자료구조와 알고리즘: 기술 면접에 필요한 실용주의 자료구조와 알고리즘
book

자바로 배우는 핵심 자료구조와 알고리즘: 기술 면접에 필요한 실용주의 자료구조와 알고리즘

by 유동환, 앨런 B. 다우니
June 2018
Beginner to intermediate
184 pages
3h 30m
Korean
Hanbit Media, Inc.
Content preview from 자바로 배우는 핵심 자료구조와 알고리즘: 기술 면접에 필요한 실용주의 자료구조와 알고리즘
172
자바로 배우는 핵심 자료구조와 알고리즘
따라서 내부 반복문의 총 실행 횟수는
1
,
2
, … ,
n
-
1
수열의 합인
n
(
n
-
1
)/
2
가 되고, 이 식의
최대 차수는
n
2
이 됩니다.
최악일 때 삽입 정렬은 이차지만, 다음과 같은 특징이 있습니다.
1
. 요소가 이미 정렬되어 있거나 거의 정렬되어 있으면 삽입 정렬은 선형입니다. 특히 각 요
소가 있어야 하는 자리 기준
k
이하의 위치에 있다면 내부 반복문은
k
번 이하로 동작하게
되고 전체 실행시간은
O
(
kn
)이 됩니다.
2
. 구현이 단순하므로 오버헤드
overhead
가 작습니다. 즉, 실행시간은
an
2
이지만 최대 차수의
계수인
a
는 아마도 작을 것입니다.
따라서 배열이 거의 정렬되어 있거나 별로 크지 않다면 삽입 정렬은 좋은 선택이 됩니다. 하지
만 큰 배열에서는 더 좋은 방법들이 있습니다. 사실은 훨씬 더 좋은 방법입니다.
17.2
실습
14
병합 정렬은 실행시간이 이차보다 좋은 알고리즘의 하나입니다. 여기에서도 알고리즘 자체를
설명하기보다
http
://
thinkdast
.
com
/
mergesort
문서를 읽어보기 바랍니다. 어떤 내용인지
알게 되면 돌아와서 실제로 구현해 보면서 이해한 내용을 확인해 보기 바랍니다.
이 책의 코드 저장소에는 실습을 위한 다음 소스 파일이 있습니다.
ListSorter ...
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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’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
QuotationMarkI 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
QuotationMarkI’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
QuotationMarkI'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.
Mark W.
Embedded Software Engineer

You might also like

자바 마이크로서비스를 활용한 SRE : 기업에서 신뢰할 수 있는 마이크로서비스를 위한 패턴

자바 마이크로서비스를 활용한 SRE : 기업에서 신뢰할 수 있는 마이크로서비스를 위한 패턴

조너선 슈나이더

Publisher Resources

ISBN: 9791162240847