의 크기와 상관없이 추가 공간은 변하지 않는다. 이는 공간 복잡도가 문제 인스턴스에 독립적
이거나 상수라는 의미다.
mutable
_
two
()
는 비슷한 동작을 보인다. 대조적으로
tournament
_
two
()
는
winner
,
loser
,
prior
라는
3
개 배열을 할당하며 이 배열들은 크기가
N
-
1
이다. 총
추가 공간은
N
이 증가함에 따라 문제 인스턴스의 크기에 정비례
3
하는 방식으로 증가한다. 토
너먼트 구조를 구성하면
largest
_
two
()
와 비교할 때
tournament
_
two
()
가 느려지게 된다.
double
_
two
()
와
sorting
_
two
()
는 입력
A
의 복사본을 만드는데, 이는 알고리즘이 저장 공간
을
largest
_
two
()
보다는
tournament
_
two
()
와 같이 사용한다는 의미다. 이 책 전반에서 각
알고리즘의 시간 ...
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.