Skip to content

Commit 726cf39

Browse files
committed
add newline
1 parent 850b67b commit 726cf39

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/examples/source-3-non-det/queens.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
/*
22
SICP JS Exercise 4.35
3+
34
This file contains two solutions for the n-queens puzzle using non-determinism.
45
Each of them makes use of the generate-and-test paradigm.
56
The first (queens_slow) uses non-determinism for generating both the row and column
67
for each position. It does so in an optimized manner, testing the corresponding condition
78
as soon as the choice is generated, thereby reducing the search space. However, this is not
89
enough to yield a quick solution when N = 8.
910
This solution also gives repeated solutions (i.e different permutations that have all the same positions) upon backtracking.
11+
1012
The second (queens_fast) uses non-determinism in picking only the row and not the column of each position, with the
1113
columns being fixed. This further reduces the search space, yielding a quick solution when N = 8.
1214
*/

0 commit comments

Comments
 (0)