Skip to Content
자바로 배우는 핵심 자료구조와 알고리즘: 기술 면접에 필요한 실용주의 자료구조와 알고리즘
book

자바로 배우는 핵심 자료구조와 알고리즘: 기술 면접에 필요한 실용주의 자료구조와 알고리즘

by 유동환, 앨런 B. 다우니
June 2018
Beginner to intermediate
184 pages
3h 30m
Korean
Hanbit Media, Inc.
Content preview from 자바로 배우는 핵심 자료구조와 알고리즘: 기술 면접에 필요한 실용주의 자료구조와 알고리즘
138
자바로 배우는 핵심 자료구조와 알고리즘
자, 새로운 버전의 인덱서를 만들어 봅시다.
14.1
레디스
이전 버전의 인덱서는 인덱스를 두 가지 자료구조에 저장합니다.
TermCounter
클래스는 검색
어별로 웹 페이지 등장 횟수를 매핑하고,
Index
클래스는 검색어별로 검색어가 등장한 페이지
의 집합을 매핑합니다.
이러한 자료구조는 실행 중인 자바 프로그램의 메모리 저장되는데, 이것은 프로그래밍이 멈추
면 인덱스가 모두 사라진다는 것을 의미합니다. 실행 중인 프로그램의 메모리에 저장된 데이터
를 휘발성
volatile
이라고 하는데, 이는 프로그램이 끝나면 모두 날아가기 때문입니다.
데이터를 생성한 프로그램이 끝나도 지속하는 데이터를 영속적
persistent
이라고 합니다. 일반적으
로 파일 시스템에 저장된 파일은 영속적이며 데이터베이스에 저장된 데이터도 마찬가지입니다.
데이터를 영속적으로 만드는 간단한 방법은 파일에 저장하는 것입니다. 프로그램이 종료되기
전에
JSON
(
http
://
thinkdast
.
com
/
json
참고)
같은 포맷으로 자료구조를 변환하여 파일에 저장합니
다. 프로그램을 재시작하면 파일에서 읽어와 자료구조를 다시 만듭니다.
하지만 이 해법에는 몇 가지 문제점이 있습니다.
(웹 인덱스 같은 )
대량의 자료구조를 읽고 쓰면 느려집니다.
전체 자료구조는 단일 실행 프로그램의 메모리에 다 들어가지 않을 수 있습니다.
프로그램이 비정상으로 종료된다면
(예를 들어 정전 )
프로그램이 마지막으로 실행된 이후의 변경사항은 ...
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

자바 마이크로서비스를 활용한 SRE : 기업에서 신뢰할 수 있는 마이크로서비스를 위한 패턴

자바 마이크로서비스를 활용한 SRE : 기업에서 신뢰할 수 있는 마이크로서비스를 위한 패턴

조너선 슈나이더

Publisher Resources

ISBN: 9791162240847