You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (!vis[0][i] && !vis[1][cur+i] && !vis[2][cur-i+n]
can be optimized to
if (!vis[0][i] && !vis[1][cur+i-n] && !vis[2][cur-i+n]
in prevention in memory abuse. e.g. cur+i maybe is bigger than the limit for N Queen Problem. Maybe subtract an n on that expression.
The text was updated successfully, but these errors were encountered:
shuzhouliu
changed the title
Considerable Optimize in Page 193, Chapter 7 (ch7/queen2.cpp)
Considerable Optimization in Page 193, Chapter 7 (ch7/queen2.cpp)
Aug 1, 2021
can be optimized to
in prevention in memory abuse.
e.g. cur+i maybe is bigger than the limit for N Queen Problem. Maybe subtract an n on that expression.
The text was updated successfully, but these errors were encountered: