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

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

by 조지 하이네만, 윤대석
May 2022
Beginner to intermediate
296 pages
5h 54m
Korean
Hanbit Media, Inc.
Content preview from 똑똑한 코드 작성을 위한 실전 알고리즘
216
똑똑한 코드 작성을 위한 실전 알고리즘
6.8
자가 균형 트리 성능 분석하기
compute
_
height
()
헬퍼 함수와 노드 회전 메서드는 모두 상수 시간에 수행되며 함수 어디에
도 추가적인 재귀 호출이나 루프가 없다. 이러한 트리 유지 함수는 노드에서 불균형이 감지될
때만 실행된다.
AVL
트리에 값을 삽입할 때 노드 회전은 두 번 이상 필요하지 않다. 값을 삭제
할 때는 이론적으로 노드 회전이 여러 번 있을 수 있다 (이 장 마지막에 있는 연습 문제에서 이
러한 동작을 알아본다 ). 최악의 경우 노드 회전은
log
(
N
)회 이하이므로 탐색, 삽입 및 삭제의
런타임 성능은 모두
O
(
log
N
)이 된다.
이제 이 장에서 배운 내용을 활용해 재귀 자료구조를 추가로 조사할 준비가 되었다. 이 장을 마
무리하면서 심볼 테이블과 우선순위 큐 데이터 타입을 재고하며 이진 트리가 더 효율적인 구현
을 제공할 수 있는지 여부를 알아보자.
6.9
이진 탐색 트리를 (키, 값) 심볼 테이블로 사용하기
같은 이진 탐색 트리 구조를 사용해
3
장에서 소개한 심볼 테이블 데이터 타입을 구현할 수 있
다(그림
6
-
14
).
그림
6-14
이진 트리를 심볼 테이블로 사용하기(키는 고유 숫자이고 값은 요소 이름이다)
217
6
이진 트리
이진 트리를 심볼 테이블로 활용하기 위해, ...
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