[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.
This commit is contained in:
David Leal
2021-08-05 13:47:05 -05:00
parent 97afa0e3e4
commit 9cc3951dba
10 changed files with 376 additions and 343 deletions

View File

@@ -22,11 +22,11 @@ template <typename T>
bool is_prime(T num) {
bool result = true;
if (num <= 1) {
return 0;
return false;
} else if (num == 2) {
return 1;
return true;
} else if ((num & 1) == 0) {
return 0;
return false;
}
if (num >= 3) {
for (T i = 3; (i * i) < (num); i = (i + 2)) {