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

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

by 조지 하이네만, 윤대석
May 2022
Beginner to intermediate
296 pages
5h 54m
Korean
Hanbit Media, Inc.
Content preview from 똑똑한 코드 작성을 위한 실전 알고리즘
126
똑똑한 코드 작성을 위한 실전 알고리즘
배열
최선의 성능을 내기 위한 구조를 만들기 어려운 정렬되지 않는 엔트리의 배열.
enqueue
()
상수 시간 연산이지만
dequeue
()
는 가장 높은 우선순위 값을 찾아 제거하고 반환하기 위해 전
체 배열을 탐색해야 한다. 배열은 크기가 고정되어 있으므로 우선순위 큐가 가득 찰 수 있다.
내장 연산
순서가 없는 리스트로, 배열과 비슷한 성능으로 제공되는 파이썬 내장 연산을 통해 제어한다.
OrderA
엔트리의 우선순위가 점점 증가하도록 정렬된 배열.
enqueue
()
에서는 이진 배열 탐색 변형
([코드
2
-
4
] 참고 )을 사용해 엔트리가 위치할 곳을 찾고, 찾은 위치의 공간을 확보하기 위해
배열 엔트리를 수동으로 시프트한다.
dequeue
()
는 엔트리가 완전히 정렬되었으므로 상수 시
간에 배열의 마지막에서 우선순위가 가장 높은 엔트리를 찾는다. 배열은 크기가 고정되어 있으
므로 우선순위 큐가 가득 찰 수 있다.
연결 리스트
첫 번째 엔트리가 리스트 내에서 가장 큰 우선순위를 가지는 연결 리스트. 각 후속 엔트리는 이
전 엔트리보다 우선순위가 작거나 같다. 해당 구현은 연결 리스트의 적절한 위치에 새로운 값
을 넣도록 해
dequeue
()
를 상수 시간에 처리하도록 한다.
OrderL
우선순위가 점점 증가하도록 오름차순으로 엔트리를 포함하는 파이썬 리스트.
enqueue
()
에서
이진 배열 탐색 변형을 사용해 알맞은 위치에 엔트리를 동적으로 삽입한다. 우선순위가 가장
높은 엔트리는 리스트의 맨 마지막에 ...
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