Skip to Content
똑똑한 코드 작성을 위한 실전 알고리즘
book

똑똑한 코드 작성을 위한 실전 알고리즘

by 조지 하이네만, 윤대석
May 2022
Beginner to intermediate
296 pages
5h 54m
Korean
Hanbit Media, Inc.
Content preview from 똑똑한 코드 작성을 위한 실전 알고리즘
72
똑똑한 코드 작성을 위한 실전 알고리즘
다. 예를 들어, 알고리즘이 두 하위 단계를 포함하는데 하나는 시간 복잡도가
O
(
N
log
N
)이고
다른 하나는
O
(
N
2
)이면 전체 복잡도는 무엇일까? 두 번째 하위 단계의 복잡도가 전체 복잡도
에 지배적인 영향이 있으므로 알고리즘의 전반적인 분류는
O
(
N
2
)이 된다. 실용적인 예로, 알
고리즘에 대한
T
(
N
)
5N
2
+
10
,
000
,
000
×
N
×
log
(
N
)으로 모델링했다면
T
(
N
)의 복잡도는
O
(
N
2
)이다.
마지막 두 복잡도 클래스인 지수와 팩토리얼은 비효율적이며, 아주 작은 문제 인스턴스를 해결
할 때만 사용 가능한 알고리즘에 해당된다. 이 장의 마지막에서 이러한 복잡도 클래스를 다루
는 연습 문제를 풀어보자.
2.10
알고리즘 성능 비교
[표
2
-
4
]는 각 복잡도 클래스에 대한
f
(
N
)의 계산을 나타낸다. 각 시간 복잡도 (열)를 갖는 알
고리즘이 크기가
N
인 문제 인스턴스 (행)를 처리하는 데 드는 예상 시간을 초로 나타낸다고 가
정하자.
4
,
096
은 약
1
시간
8
분이므로
1
시간이 조금 넘는 시간 내에 다음과 같은 크기를 처리
할 수 있다.
O
(
1
) 알고리즘 : 성능이 문제 인스턴스 크기와 무관
O
(
log
N
) 알고리즘 : 문제 인스턴스 크기
2
4096
개 이하
O
(
N
) 알고리즘 : 문제 인스턴스 크기
4096
개 이하
O
(
N
log
N
) 알고리즘 : 문제 인스턴스 크기
462
개 이하
O
(
N
2
) 알고리즘 : 문제 인스턴스 크기
64
개 이하
O
(
N
3
) 알고리즘 : 문제 인스턴스 크기
16
개 이하 ...
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

데이터 익명화를 위한 파이프라인

데이터 익명화를 위한 파이프라인

루크 아버클, 칼리드 엘 에맘
개발 7년차, 매니저 1일차

개발 7년차, 매니저 1일차

권원상, 한민주, 카미유 푸르니에

Publisher Resources

ISBN: 9791162245644