mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-07-03 02:26:48 +08:00
[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:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user