mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-04-14 02:30:40 +08:00
[feat/fix/docs]: Improvements in the backtracking folder (#1553)
* [feat/fix/docs]: Improvements in the...
...`backtracking` folder, and minor fixes in the `others/iterative_tree_traversals.cpp` and the `math/check_prime.cpp` files.
* clang-format and clang-tidy fixes for 9cc3951d
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Abhinn Mishra <49574460+mishraabhinn@users.noreply.github.com>
This commit is contained in:
@@ -111,7 +111,7 @@ int main() {
|
||||
std::array<std::array<int, n>, n> board{};
|
||||
|
||||
if (n % 2 == 0) {
|
||||
for (int i = 0; i <= n / 2 - 1; i++) { // 😎
|
||||
for (int i = 0; i <= n / 2 - 1; i++) {
|
||||
if (backtracking::n_queens_optimized::CanIMove(board, i, 0)) {
|
||||
board[i][0] = 1;
|
||||
backtracking::n_queens_optimized::NQueenSol(board, 1);
|
||||
@@ -119,7 +119,7 @@ int main() {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i <= n / 2; i++) { // 😏
|
||||
for (int i = 0; i <= n / 2; i++) {
|
||||
if (backtracking::n_queens_optimized::CanIMove(board, i, 0)) {
|
||||
board[i][0] = 1;
|
||||
backtracking::n_queens_optimized::NQueenSol(board, 1);
|
||||
|
||||
Reference in New Issue
Block a user