DFS(Depth-First Search) 깊이우선탐색이라고도 불린다. 그래프에서 깊은 부분을 우선적으로 탐색하는 알고리즘이다.
그리디 알고리즘 (탐욕법) 그리디는 이름에서 알 수 있듯, 단순하고 탐욕적으로 문제를 해결하는 방법이다. 이때 탐욕적이라는 말은 '현재 상황에서 지금 당장 좋은것만 고르는 방법'을 의미한다. 그리디 알고리즘에서 현재의 선택은 미래를 고려하지 않는다. 거스름돈 그리디의
너비우선탐색이라고도 불린다. 그래프를 깊게보다는 가까운 노드부터 넓게 탐색하는 알고리즘이다.BFS의 탐색 순서는 다음과 같다. 탐색 시작 노드를 큐에 삽입하고 방문처리를 한다.큐에서 노드를 꺼내 해당 노드의 인접노드 중에서 방문하지 않은 노드를 모두 큐에 삽입하고 방문