DFS
-
[Algorithm] 백준 알고리즘 1260 (DFS와 BFS)Algorithm 2020. 3. 15. 22:52
java 코드 import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; public class Main { static int n; static int m; static int v; static int map[][]; static boolean visit[]; public static void main(String[] args) { Scanner sc = new Scanner(System.in); n = sc.nextInt(); m = sc.nextInt(); v = sc.nextInt(); map = new int[n+1][n+1]; visit = new boolean[n+1]; for(int i=0; i