Пример #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);
 }