마지막 두 복잡도 클래스인 지수와 팩토리얼은 비효율적이며, 아주 작은 문제 인스턴스를 해결
할 때만 사용 가능한 알고리즘에 해당된다. 이 장의 마지막에서 이러한 복잡도 클래스를 다루
는 연습 문제를 풀어보자.
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.
O’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
I 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
I’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
I'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.