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

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

by 조지 하이네만, 윤대석
May 2022
Beginner to intermediate
296 pages
5h 54m
Korean
Hanbit Media, Inc.
Content preview from 똑똑한 코드 작성을 위한 실전 알고리즘
278
똑똑한 코드 작성을 위한 실전 알고리즘
node_from[][]
구조는
src
에서 모든
target
까지 경로를 복구하는 데 필요하다.
완전 경로를 복구하기 위해
target
에서 시작한다.
v
src
가 아닐 때까지
v
path
에 넣으면,
src
에서
target
까지 찾은 노드의 역방향 리스트가 된다.
node_from[src][v]
에 기록된 대로
v
가 이전 노드가 되도록 설정한다.
v
src
와 같다면,
while
루프는 종료하고
path
가 완전해지도록
src
를 추가한다.
src
에서
target
까지 알맞은 순서로 나타나도록 리스트를 뒤집는다.
node_from[target]
None
이면
target
src
에서 도달 가능하지 않다는 것이다.
7.9
요약
그래프는 지리 정보에서 소셜 네트워크의 관계 정보까지 다양한 애플리케이션 도메인을 모델
링할 수 있다. 그래프의 간선은 방향이 있거나 없을 수 있고, 간선은 숫자 가중치를 저장할 수
있다. 그래프가 주어지면 자연스럽게 여러 흥미로운 질문들이 생긴다.
그래프가 연결되어 있는가? 깊이 우선 탐색을 사용해 그래프 내 모든 노드가 방문되었는지 확인해보자.
유향 그래프는 순환을 포함할 수 있는가? 깊이 우선 탐색을 사용해 순환 유무를 검출하기 위해 탐색하
는 동안 추가 상태를 관리해보자.
그래프의 두 노드
u
v
가 주어지면, 포함하는 간선 개수 측면에서
u
에서
v
까지의 최단 경로는 무엇일
까? 너비 우선 탐색을 사용해 문제를 해결해보자.
가중 그래프와 시작 노드 ...
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