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

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

by 조지 하이네만, 윤대석
May 2022
Beginner to intermediate
296 pages
5h 54m
Korean
Hanbit Media, Inc.
Content preview from 똑똑한 코드 작성을 위한 실전 알고리즘
53
2
알고리즘 분석
선형 모델
TL
은 총 시간을 과소평가하고 이차 모델
TQ
는 과대평가한다.
N
=
10
,
000
,
000
일 때
TL
5
,
957
초(
10
분)가 걸린다고 선언하고
TQ
326
,
300
초(
91
시간 )가 걸린다고 선언
한다.
TN
은 실제 성능이
9
,
879
초(
2
.
75
시간 )일 때
10
,
421
초(
2
.
9
시간 )로 추정하므로 성능
을 더 잘 예측한다.
다행히 프로토타입은 밤새 처리를 완료할 수 있지만, 프로토타입에 도입한 자료구조와 알고리
즘을 확인해야만 문제 인스턴스에 관계없이 결과를 보장할 수 있다.
공식
a
×
N
×
log
(
N
)이 동작을 잘 모델링하는 이유는 무엇일까? 이는 프로토타입 애플리케이
션 내에서 사용한 기본 알고리즘과 관련이 있다. 앞서 살펴본 선형 모델, 이차 모델,
N
log
N
알고리즘을 분석하는 데 일반적으로 사용된다. 약
50
년 전에 발견된 놀라운 결과를 보여주는
예제 하나를 더 보도록 하자.
2
2.2
곱셈 성능 예측하기
[코드
2
-
2
]에 있는 두 가지 예시를 보자. 초등학교에서 배운 알고리즘을 사용해 두
N
자리 정
수를 곱한다. 해당 알고리즘을 정확하게 정의하지는 않겠지만 최종 답을 계산하기 위해 합산된
원래 숫자 아래에 나열된
N
개의 곱을 생성함을 볼 수 있다.
코드
2-2
초등학교 알고리즘을 사용해 두
N
자리 정수 곱하기
456 ...
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