July 2001
Intermediate to advanced
592 pages
11h 16m
English
The above stylesheet was tested using James Clark's XT XSLT processor. I also wrote a C++ implementation. Running both on my computer yielded the results in Table C-1.
| Number of Queens | Number of Solutions | Time to run in XSLT | Time to run in C++ |
|---|---|---|---|
| 4 | 2 | 1.0 second | 0.065 seconds |
| 6 | 4 | 1.5 second | 0.065 seconds |
| 8 | 92 | 8.5 seconds | 0.065 seconds |
| 10 | 724 | 3.0 minutes | 0.180 seconds |
XT is a pretty fast XSLT processor. It is just not optimized for the kind of processing this stylesheet performs. Not only that, while the stylesheet does print all the solutions to the N-Queens problem, it does not print a serial number by each. It turns out that doing so is a non-trivial ...
Read now
Unlock full access