The Position class is (although probably good design) quite redundant: you construct an array of Position objects, of which the row (first argument of the constructor) is always the same as the index in the array. In effect the int array queens
at that point already contains all information for the solution. The conversion to Positions doesn't add any information, is redundant and the performance would increase (marginally) by removing it.
Maarten Winkels
- 438
- 3
- 3