[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:
David Leal
2021-10-29 13:05:46 -05:00
committed by GitHub
parent a9312b3901
commit 4e3abd4601
8 changed files with 367 additions and 322 deletions

View File

@@ -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);