[그래프]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
- 파이썬
- DB
- leetcode
- mdn
- 브라우저
- 함수
- react
- DOM
- 리액트
- error
- Browser
- JavaScript
- 알고리즘
- 그래프
- useState
- git
- React Query
- Component
- Context API
- CSS
- Python
- 데이터베이스
- 자료구조
- BOJ
- state
- 자바스크립트
- 에러
- zustand
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함
250x250