mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-04-04 19:20:17 +08:00
feat: add binary_insertion_sort (#1850)
* Add binary_insertion_sort.cpp * Update binary_insertion_sort.cpp * Update sorting/binary_insertion_sort.cpp Co-authored-by: David Leal <halfpacho@gmail.com> * Update binary_insertion_sort.cpp * Update binary_insertion_sort.cpp * updating DIRECTORY.md * clang-format and clang-tidy fixes ford48126b7* clang-format and clang-tidy fixes for30cafcabCo-authored-by: David Leal <halfpacho@gmail.com> 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:
committed by
GitHub
parent
5592f0449b
commit
e6b17203c7
@@ -45,13 +45,14 @@ const std::vector<std::vector<std::string>> test_set = {
|
||||
|
||||
/** Main function */
|
||||
int main() {
|
||||
for (size_t i = 0; i < test_set.size(); i++) {
|
||||
int output = brute_force(test_set[i][0], test_set[i][1]);
|
||||
for (const auto &i : test_set) {
|
||||
int output = brute_force(i[0], i[1]);
|
||||
|
||||
if (std::to_string(output) == test_set[i][2])
|
||||
if (std::to_string(output) == i[2]) {
|
||||
std::cout << "success\n";
|
||||
else
|
||||
} else {
|
||||
std::cout << "failure\n";
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user