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

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

by 조지 하이네만, 윤대석
May 2022
Beginner to intermediate
296 pages
5h 54m
Korean
Hanbit Media, Inc.
Content preview from 똑똑한 코드 작성을 위한 실전 알고리즘
74
똑똑한 코드 작성을 위한 실전 알고리즘
이렇게 매우 큰 수들은 일반적으로 [그림
2
-
8
]과 같이 시각화한다.
x
축은 해결할 문제 인스턴
스 크기를 나타내며
y
축은 알고리즘별 총 예상 런타임 성능을 나타낸다. 알고리즘의 복잡도가
증가함에 따라 ‘합리적인 시간’에 해결이 가능한 문제 인스턴스의 크기는 감소한다.
다음과 같이 복잡한 시나리오를 고려해보자.
누군가가 알고리즘을
O
(
N
2
+
N
)으로 분류한다면 당신의 응답은 무엇인가? [그림
2
-
7
]의 우세 계층에
N
2
N
보다 복잡도가 높으므로
O
(
N
2
+
N
)
O
(
N
2
)으로 단순화할 수 있다. 비슷하게,
O
(
2
N
+
N
8
)
O
(
2
N
)으로 단순화할 수 있다.
알고리즘이
O
(
50
×
N
3
)으로 분류된다면, 상수의 곱셈은 제거할 수 있으므로
O
(
N
3
)으로 단순화할 수
있다.
알고리즘의 동작이 때로는 문제 인스턴스 크기
N
보다 다른 속성에 더 의존적일 수 있다. 예를 들어, 숫
자 값
N
개를 런타임 성능이
N
에 정비례하는 핵심 작업으로 처리하는 알고리즘을 고려하자. 이 알고리즘
이 문제 인스턴스 내 모든 짝숫값을 처리하는 하위 작업을 가진다고 가정하자. 해당 하위 작업의 런타임
성능은
E
2
(여기서
E
는 짝숫값 개수 )에 정비례한다. 당신은 아마 알고리즘의 런타임 성능을
O
(
N
+
E
2
)으
로 지정하고 싶을 것이다. 예를 들어, 만약 입력 세트에서 모든 짝숫값을 제거할 수 있다면 성능을
O
(
N
)
으로 평가할 수 있으며, 이는 주목할 만하다.
E
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

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

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

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

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

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

Publisher Resources

ISBN: 9791162245644