알고리즘 (18) 썸네일형 리스트형 [DFS] Nqueen Algorithm 12345678910111213141516171819202122232425262728293031323334353637383940import java.util.Scanner; // N Queen// http://jungol.co.kr/problem.php?id=1889public class NQueen { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] check = new int[n]; int count = 0; public void queenCount(int deep){ if(deep == n){ count++; return; } for(int i = 0; i [Algorithm] KMP Algorithm 으로 indexOf구현하기 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 32 33 34 public class indexOf { public static void main(String[] args) { indexOf s = new indexOf(); System.out.println(s.indexOf( "abcabfabcabceabcabf", "abcabce")); } int[] flow ; public void setFlow(String str, String target) { flow = new int[target.length()+1]; int i =0 , j = -1; flow[0] = -1; while(i 이전 1 2 3 다음