Template Function ADS::nQueens

Function Documentation

template<class F>
long ADS::nQueens(int n, F &&f)

the placements of n <= 32 queens, f( Q ) on each, Q[ r ] the column of the queen of row r; f returns true to stop; the number found

Pre:

1 <= n <= 32

Post:

each solution admissible