Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
Tags
- 격파르타 합격후기
- 야근지수
- 구슬탈출2
- 코딩테스트
- Interview Preparation Kit
- 파이썬
- 머신러닝
- Special String Again
- BFS: Shortest Reach in a Graph
- 피보나치 함수
- Roads and Libraries
- 격파르타 장점
- programmers
- Common Child
- 해커랭크
- 격파르타 후기
- candies
- 프로그래머스
- 알고리즘
- 매칭점수
- hackerrank
- DFS: Connected Cell in a Grid
- Find the nearest clone
- Max Array Sum
- 백준
- [sqld]자격증합격
- Reverse Shuffle Merge
- Recursion: Davis' Staircase
- Algorithm
- python
Archives
- Today
- Total
목록BFS: Shortest Reach in a Graph (1)
Archive

https://www.hackerrank.com/challenges/ctci-bfs-shortest-reach/problem BFS: Shortest Reach in a Graph | HackerRank Implement a Breadth First Search (BFS). www.hackerrank.com 풀이 그래프와 시작노드가 주어졌을 때 BFS로 다른 노드까지의 depth를 구하는 문제. 도달할 수 없으면 -1 리턴. BFS로 depth를 구할 때, 아래와 같은 순서대로 풀면 됨. 먼저 start_node를 정의(혹은 주어짐). 방문 정보를 저장할 visited 리스트 0으로 초기화. start_node에 대해서는 1로 처리 queue에 start_node 저장. depth는 dictionary를..
카테고리 없음
2020. 9. 5. 16:12