I am Software Engineer at [login to view URL],
I have won a lot speed programming Competitions and my specialty is Data structures and Algorithm.
here are the algorithms i will be coding in C++ for you. And If you want I can teach you how it is actually working.. though you will have a little bit concept from below algorithms I will be using.
For NQueen Simple
while there are untried conflagrations
{
generate the next configuration
if queens don't attack in this configuration then
{
print this configuration;
}
}
BackTracking Algorithm:
1) Start in the leftmost column
2) If all queens are placed
return true
3) Try all rows in the current column. Do following for every tried row.
a) If the queen can be placed safely in this row then mark this [row,
column] as part of the solution and recursively check if placing
queen here leads to a solution.
b) If placing queen in [row, column] leads to a solution then return
true.
c) If placing queen doesn't lead to a solution then umark this [row,
column] (Backtrack) and go to step (a) to try other rows.
3) If all rows have been tried and nothing worked, return false to trigger
backtracking.
I am currently writing algorithm for Local Search. But I assure you to complete it on time.