mirror of
https://hub.njuu.cf/TheAlgorithms/C-Plus-Plus.git
synced 2023-10-11 13:05:55 +08:00
fix: self-test example not working
This commit is contained in:
parent
4ca4333efe
commit
c0c27153cd
@ -81,8 +81,9 @@ assert(backtracking::subset_sum::number_of_subsets(0, array1) ==
|
|||||||
3. Small C++ program that showcases and explains the use of tests.
|
3. Small C++ program that showcases and explains the use of tests.
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
#include <vector> /// for std::vector
|
#include <iostream> /// for IO operations
|
||||||
#include <cassert> /// for assert
|
#include <vector> /// for std::vector
|
||||||
|
#include <cassert> /// for assert
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Verifies if the given array
|
* @brief Verifies if the given array
|
||||||
@ -100,7 +101,7 @@ bool is_number_on_array(const std::vector<T> &arr, const int &number) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return false;
|
// Number not in the current index, keep searching.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user