예제 #1
0
 @Test
 public void testSolveNQueens3() {
   ArrayList<String[]> result = s.solveNQueens(4);
   for (String[] sa : result) {
     System.out.println(Arrays.asList(sa));
   }
   assertNotNull(result);
   assertTrue(result.size() == 2);
 }
예제 #2
0
 @Test
 public void testSolveNQueens4() {
   ArrayList<String[]> result = s.solveNQueens(9);
   for (String[] sa : result) {
     System.out.println(Arrays.asList(sa));
   }
   assertNotNull(result);
   assertTrue("number of distinct solutions " + result.size(), result.size() == 352);
 }
예제 #3
0
 @Test
 public void testSolveNQueens1() {
   ArrayList<String[]> result = s.solveNQueens(0);
   assertNotNull(result);
   assertTrue(result.size() == 0);
 }