[GC02] DFS/BFS

  • tags: 그래프 이론, 그래프 탐색, 너비 우선 탐색, 깊이 우선 탐색
  • lev: s2

  • Python3

    • 000000
    • 01:30 .00
    • 시도: 0번

메모

  • DFS, BFS 푸는 방식 -> Traverse하는 순서를 잘 생각하기!!
    • DFS: Recursive
    • BFS: Iterative (BFS는 재귀로 동작안함!!)
  • python global (전역변수) 설정
  • 백준 1260 문제 풀어보기

참고

  • y = 10
    
    def some_func():
      global y
      y = 20
        
    print(y)
    some_func()
    print(y)
    
  • https://gmlwjd9405.github.io/2018/08/15/algorithm-bfs.html
  • https://junghyeonsu.tistory.com/97
  • https://www.acmicpc.net/problem/1260




Link