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

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

by 조지 하이네만, 윤대석
May 2022
Beginner to intermediate
296 pages
5h 54m
Korean
Hanbit Media, Inc.
Content preview from 똑똑한 코드 작성을 위한 실전 알고리즘
61
2
장
알고리즘 분석
●
O
(
N
) :
f
(
N
) =
N
인 선형 복잡도 클래스
●
O
(
N
1
.
585
) :
f
(
N
) =
N
1
.
585
인 카라추바 복잡도 클래스
●
O
(
N
2
) :
f
(
N
) =
N
2
인 이차 복잡도 클래스
●
O
(
N
log
N
) :
f
(
N
) =
N
×
log
N
인 복잡도 클래스
정확한 분석을 수행하려면 알고리즘의 구조를 보기 위한 소스 코드를 조사해야 한다. 다음 예
제 코드에서 핵심 연산
ct
=
ct
+
1
을 몇 번 수행했는지 살펴보자.
for i in range(100):
for j in range(N):
ct = ct + 1
외부
i
루프에서
100
회 수행하는데 각 루프에서 내부
j
루프가
N
회 수행된다. 따라서
ct
=
ct
+
1
은 총
100
×
N
회 수행된다. 크기가
N
인 문제 인스턴스에서 앞선 코드를 실행하기 위
한 총 시간
T
(
N
)은 적절히 선택된
c
의
c
×
N
보다 작다. 실제 컴퓨터에서 해당 코드를 실행하
면 정확한
c
를 결정할 수 있을 것이다. 더 정확히는 빅오 표기법을 사용해 해당 코드의 성능을
O
(
N
)으로 나타낼 수 있다.
각기 다른 컴퓨팅 시스템에서 이 코드를 수천 번 수행해 매번 다른
c
를 계산할 수 있다. 이 사
실은 참이며
O
(
N
)으로 코드 성능을 분류할 수 있는 이유다. 이론적 세부 사항은 설명하지 않
지만, 알고리즘의 연산 횟수를 나타내는 함수
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

AI를 위한 필수 수학

AI를 위한 필수 수학

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

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

루크 아버클, 칼리드 엘 에맘

Publisher Resources

ISBN: 9791162245644