[그래프]DFS 구현 방법을 알아보자
1) 재귀를 이용한 DFS 구현 Pseudo code G는 그래프, v는 정점(vertex)일 때, DFS(G,v) lable v as discovered for all directed edges from v to w that are in G.adjacentEdges(v) do if vertex w is not labeled as discovered then recursively call DFS(G,w) 재귀를 이용한 DFS 구현 Python code def recursive_dfs(v, discovered=[]): discovered.append(v) for w in graph[v]: if w not in discovered: discovered = recusrive_dfs(w, discovered) ..
🧑🏻💻 알고리즘/그래프
2022. 10. 23. 17:45
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- 자바스크립트
- github
- 데이터베이스
- CSS
- 리액트
- Component
- react
- useState
- 자료구조
- DB
- 에러
- 브라우저
- React Query
- Python
- git
- DOM
- BOJ
- error
- 파이썬
- leetcode
- zustand
- 정렬
- state
- JavaScript
- Browser
- mdn
- Context API
- 함수
- 그래프
- 알고리즘
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함
250x250