This is a C implementation of the Eight (N) Queens algorithm.
Comparing speed to my scala implementation of a similar algorithm. It's actually not much faster. I may try to optimize it in both.
N | Solutions | Time in C | Time in Scala |
10 | 724 | 0s | 1s |
11 | 2680 | 0s | 0s |
12 | 14200 | 2s | 2s |
13 | 73712 | 9s | 9s |
14 | 365596 | 60s | 60s |
15 | 2279184 | 421s | 462s |
Copyright 2012 Wes Freeman
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see http://www.gnu.org/licenses/