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

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

by 조지 하이네만, 윤대석
May 2022
Beginner to intermediate
296 pages
5h 54m
Korean
Hanbit Media, Inc.
Content preview from 똑똑한 코드 작성을 위한 실전 알고리즘
116
똑똑한 코드 작성을 위한 실전 알고리즘
연결 리스트 자료구조는 동적 삽입과 제거를 허용해 작은 컬렉션을 효율적으로 저장할 수 있다.
심볼 테이블은 엔트리를 저장하는 데 버킷이
M
개인 저장 배열을 사용한다. 이때, 같은 버킷으로 할당되
는 키 해시가 두 개 이상일 때 충돌을 해결할 전략이 있어야 한다.
개방 주소법은 충돌 횟수를 줄이기 위해 배열 내 항목을 분산하는 데 의존하지만, 이는 저장 배열 크기
M
이 저장된 엔트리 개수
N
보다
2
배 이상 클 때만 효율적으로 동작한다. 키 제거를 지원하는 두 가지 접
근에 대한 연습 문제를 확인하자.
분리 연쇄법은 해시 코드가 동일한 키를 가지는 엔트리를 저장하는 데 연결 리스트를 사용한다. 해당 접
근은 키에 대한 제거 연산을 더 쉽게 지원할 수 있다.
해시 함수를 설계하기는 어렵다. 그러니 파이썬 설계자가 고안한 미리 정의된 것을 사용하자.
기하학적 크기 재조정은 미래에 발생할 크기 조정의 빈도를 감소해 심볼 테이블이 효율적인 상태로 유
지되도록 한다.
완벽한 해싱은 개수가 고정된 키에 대해 고유한 인덱스 위치를 계산해 충돌을 회피하는 해시 함수를 구
성하기 위해 사용한다. 해당 해시 함수는 기본으로 제공되는
hash()
함수보다 더 많이 계산해야 하는 경
우가 종종 있다.
3.13
연습 문제
1.
충돌을 해결하기 위해 다른 전략을 사용하면 개방 주소법의 성능이 향상될까? 바로 다음
인덱스를 선택하는 선형 조사를 사용하는 대신에 크기가
2
의 거듭제곱인 해시 테이블을 생
성하고, ...
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