mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-04-06 03:59:36 +08:00
style: remove unused params of main (#2948)
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
This commit is contained in:
@@ -204,11 +204,9 @@ static void test() {
|
||||
|
||||
/**
|
||||
* @brief Main function
|
||||
* @param argc commandline argument count (ignored)
|
||||
* @param argv commandline array of arguments (ignored)
|
||||
* @returns 0 on exit
|
||||
*/
|
||||
int main(int argc, char *argv[]) {
|
||||
int main() {
|
||||
test(); // run self-test implementations
|
||||
// code here
|
||||
return 0;
|
||||
|
||||
@@ -155,11 +155,9 @@ static void test() {
|
||||
|
||||
/**
|
||||
* @brief Main function
|
||||
* @param argc commandline argument count (ignored)
|
||||
* @param argv commandline array of arguments (ignored)
|
||||
* @returns 0 on exit
|
||||
*/
|
||||
int main(int argc, char *argv[]) {
|
||||
int main() {
|
||||
test(); // run self-test implementations
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1291,8 +1291,8 @@ static void test2(int64_t n) {
|
||||
|
||||
/**
|
||||
* @brief Main function
|
||||
* @param argc commandline argument count (ignored)
|
||||
* @param argv commandline array of arguments (ignored)
|
||||
* @param argc commandline argument count
|
||||
* @param argv commandline array of arguments
|
||||
* @returns 0 on exit
|
||||
*/
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
@@ -11,7 +11,7 @@ int fib(int n) {
|
||||
}
|
||||
return res[1];
|
||||
}
|
||||
int main(int argc, char const *argv[]) {
|
||||
int main() {
|
||||
int n;
|
||||
cout << "Enter n: ";
|
||||
cin >> n;
|
||||
|
||||
@@ -74,11 +74,9 @@ static void test() {
|
||||
|
||||
/**
|
||||
* @brief Main function
|
||||
* @param argc commandline argument count (ignored)
|
||||
* @param argv commandline array of arguments (ignored)
|
||||
* @returns 0 on exit
|
||||
*/
|
||||
int main(int argc, char const *argv[]) {
|
||||
int main() {
|
||||
uint32_t n = 0;
|
||||
|
||||
std::cout << "Enter size of array: ";
|
||||
|
||||
@@ -29,7 +29,7 @@ int LIS(const std::vector<int>& arr, int n) {
|
||||
}
|
||||
return active.size(); // size of the LIS.
|
||||
}
|
||||
int main(int argc, char const* argv[]) {
|
||||
int main() {
|
||||
int n;
|
||||
cout << "Enter size of array: ";
|
||||
cin >> n;
|
||||
|
||||
@@ -79,11 +79,9 @@ static void test() {
|
||||
|
||||
/**
|
||||
* @brief Main function
|
||||
* @param argc commandline argument count (ignored)
|
||||
* @param argv commandline array of arguments (ignored)
|
||||
* @returns 0 on exit
|
||||
*/
|
||||
int main(int argc, char *argv[]) {
|
||||
int main() {
|
||||
test(); // run self-test implementations
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -166,11 +166,9 @@ static void test() {
|
||||
|
||||
/**
|
||||
* @brief main function
|
||||
* @param argc commandline argument count (ignored)
|
||||
* @param argv commandline array of arguments (ignored)
|
||||
* @returns 0 on exit
|
||||
*/
|
||||
int main(int argc, char *argv[]) {
|
||||
int main() {
|
||||
test(); // run self-test implementations
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -136,10 +136,8 @@ static void test3() {
|
||||
/**
|
||||
* Main function
|
||||
*
|
||||
* @param argc commandline argument count (ignored)
|
||||
* @param argv commandline array of arguments (ignored)
|
||||
*/
|
||||
int main(int argc, char **argv) {
|
||||
int main() {
|
||||
test1();
|
||||
test2();
|
||||
test3();
|
||||
|
||||
@@ -186,11 +186,9 @@ static void test() {
|
||||
|
||||
/**
|
||||
* @brief Main function
|
||||
* @param argc commandline argument count (ignored)
|
||||
* @param argv commandline array of arguments (ignored)
|
||||
* @return int 0 on exit
|
||||
*/
|
||||
int main(int argc, char* argv[]) {
|
||||
int main() {
|
||||
test(); // run self-test implementations
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -579,7 +579,7 @@ double get_clock_diff(clock_t start_t, clock_t end_t) {
|
||||
}
|
||||
|
||||
/** Main function */
|
||||
int main(int argc, char **argv) {
|
||||
int main() {
|
||||
#ifdef _OPENMP
|
||||
std::cout << "Using OpenMP based parallelization\n";
|
||||
#else
|
||||
|
||||
@@ -454,7 +454,7 @@ double get_clock_diff(clock_t start_t, clock_t end_t) {
|
||||
}
|
||||
|
||||
/** Main function */
|
||||
int main(int argc, char **argv) {
|
||||
int main() {
|
||||
#ifdef _OPENMP
|
||||
std::cout << "Using OpenMP based parallelization\n";
|
||||
#else
|
||||
|
||||
@@ -72,11 +72,9 @@ static void test() {
|
||||
|
||||
/**
|
||||
* @brief Main function
|
||||
* @param argc commandline argument count (ignored)
|
||||
* @param argv commandline array of arguments (ignored)
|
||||
* @returns 0 on exit
|
||||
*/
|
||||
int main(int argc, char *argv[]) {
|
||||
int main() {
|
||||
test();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -106,11 +106,9 @@ static void test() {
|
||||
|
||||
/**
|
||||
* @brief Main function
|
||||
* @param argc commandline argument count (ignored)
|
||||
* @param argv commandline array of arguments (ignored)
|
||||
* @returns 0 on exit
|
||||
*/
|
||||
int main(int argc, char *argv[]) {
|
||||
int main() {
|
||||
test(); // execute the tests
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -73,11 +73,9 @@ static void test() {
|
||||
|
||||
/**
|
||||
* @brief Main function
|
||||
* @param argc commandline argument count (ignored)
|
||||
* @param argv commandline array of arguments (ignored)
|
||||
* @returns 0 on exit
|
||||
*/
|
||||
int main(int argc, char *argv[]) {
|
||||
int main() {
|
||||
test(); // executing tests
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ void test_function(const float *test_data, const int number_of_samples) {
|
||||
}
|
||||
|
||||
/** Main function */
|
||||
int main(int argc, char **argv) {
|
||||
int main() {
|
||||
const float test_data1[] = {3, 4, 5, -1.4, -3.6, 1.9, 1.};
|
||||
test_function(test_data1, sizeof(test_data1) / sizeof(test_data1[0]));
|
||||
|
||||
|
||||
@@ -87,13 +87,11 @@ static void test() {
|
||||
|
||||
/**
|
||||
* @brief Main function
|
||||
* @param argc commandline argument count (ignored)
|
||||
* @param argv commandline array of arguments (ignored)
|
||||
* calls automated test function to test the working of fast fourier transform.
|
||||
* @returns 0 on exit
|
||||
*/
|
||||
|
||||
int main(int argc, char const *argv[]) {
|
||||
int main() {
|
||||
test(); // run self-test implementations
|
||||
// with 2 defined test cases
|
||||
return 0;
|
||||
|
||||
@@ -163,8 +163,8 @@ static void test(std::int32_t N, double h, double a, double b,
|
||||
|
||||
/**
|
||||
* @brief Main function
|
||||
* @param argc commandline argument count (ignored)
|
||||
* @param argv commandline array of arguments (ignored)
|
||||
* @param argc commandline argument count
|
||||
* @param argv commandline array of arguments
|
||||
* @returns 0 on exit
|
||||
*/
|
||||
int main(int argc, char** argv) {
|
||||
|
||||
@@ -154,13 +154,11 @@ static void test() {
|
||||
|
||||
/**
|
||||
* @brief Main function
|
||||
* @param argc commandline argument count (ignored)
|
||||
* @param argv commandline array of arguments (ignored)
|
||||
* calls automated test function to test the working of fast fourier transform.
|
||||
* @returns 0 on exit
|
||||
*/
|
||||
|
||||
int main(int argc, char const *argv[]) {
|
||||
int main() {
|
||||
test(); // run self-test implementations
|
||||
// with 2 defined test cases
|
||||
return 0;
|
||||
|
||||
@@ -148,13 +148,11 @@ static void test() {
|
||||
|
||||
/**
|
||||
* @brief Main function
|
||||
* @param argc commandline argument count (ignored)
|
||||
* @param argv commandline array of arguments (ignored)
|
||||
* calls automated test function to test the working of fast fourier transform.
|
||||
* @returns 0 on exit
|
||||
*/
|
||||
|
||||
int main(int argc, char const *argv[]) {
|
||||
int main() {
|
||||
test(); // run self-test implementations
|
||||
// with 2 defined test cases
|
||||
return 0;
|
||||
|
||||
@@ -81,7 +81,7 @@ void test2() {
|
||||
}
|
||||
|
||||
/** Main function */
|
||||
int main(int argc, char **argv) {
|
||||
int main() {
|
||||
std::srand(std::time(NULL)); // random number initializer
|
||||
|
||||
test1();
|
||||
|
||||
@@ -155,8 +155,8 @@ static void test(std::int32_t N, double h, double a, double b,
|
||||
|
||||
/**
|
||||
* @brief Main function
|
||||
* @param argc commandline argument count (ignored)
|
||||
* @param argv commandline array of arguments (ignored)
|
||||
* @param argc commandline argument count
|
||||
* @param argv commandline array of arguments
|
||||
* @returns 0 on exit
|
||||
*/
|
||||
int main(int argc, char** argv) {
|
||||
|
||||
@@ -391,11 +391,9 @@ static void test() {
|
||||
|
||||
/**
|
||||
* @brief Main function
|
||||
* @param argc commandline argument count (ignored)
|
||||
* @param argv commandline array of arguments (ignored)
|
||||
* @returns 0 on exit
|
||||
*/
|
||||
int main(int argc, char *argv[]) {
|
||||
int main() {
|
||||
test(); // run self-test implementations
|
||||
|
||||
operations_on_datastructures::inorder_traversal_of_bst::Node *root =
|
||||
|
||||
@@ -459,11 +459,9 @@ static void test() {
|
||||
|
||||
/**
|
||||
* @brief Main function
|
||||
* @param argc commandline argument count (ignored)
|
||||
* @param argv commandline array of arguments (ignored)
|
||||
* @returns 0 on exit
|
||||
*/
|
||||
int main(int argc, char const *argv[]) {
|
||||
int main() {
|
||||
test(); // run self-test implementations
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -191,11 +191,9 @@ static void test(const std::vector<int> &vals, int windowSize) {
|
||||
|
||||
/**
|
||||
* @brief Main function
|
||||
* @param argc command line argument count (ignored)
|
||||
* @param argv command line array of arguments (ignored)
|
||||
* @returns 0 on exit
|
||||
*/
|
||||
int main(int argc, const char *argv[]) {
|
||||
int main() {
|
||||
/// A few fixed test cases
|
||||
test({1, 2, 3, 4, 5, 6, 7, 8, 9},
|
||||
3); /// Array of sorted values; odd window size
|
||||
|
||||
@@ -353,11 +353,9 @@ static void test() {
|
||||
|
||||
/**
|
||||
* @brief Main function
|
||||
* @param argc commandline argument count (ignored)
|
||||
* @param argv commandline array of arguments (ignored)
|
||||
* @returns 0 on exit
|
||||
*/
|
||||
int main(int argc, char *argv[]) {
|
||||
int main() {
|
||||
test(); // run self-test implementations
|
||||
|
||||
std::vector<uint64_t> mainlistData = {
|
||||
|
||||
@@ -91,7 +91,7 @@ void non_recursive_merge_sort(const Iterator first, const Iterator last) {
|
||||
|
||||
using sorting::non_recursive_merge_sort;
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
int main() {
|
||||
int size;
|
||||
std::cout << "Enter the number of elements : ";
|
||||
std::cin >> size;
|
||||
|
||||
@@ -49,7 +49,7 @@ void print(int a[], int n) {
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
int main(int argc, char const* argv[]) {
|
||||
int main() {
|
||||
int a[] = {170, 45, 75, 90, 802, 24, 2, 66};
|
||||
int n = sizeof(a) / sizeof(a[0]);
|
||||
radixsort(a, n);
|
||||
|
||||
@@ -316,11 +316,9 @@ static void test() {
|
||||
|
||||
/**
|
||||
* @brief Main function
|
||||
* @param argc commandline argument count (ignored)
|
||||
* @param argv commandline array of arguments (ignored)
|
||||
* @returns 0 on exit
|
||||
*/
|
||||
int main(int argc, char *argv[]) {
|
||||
int main() {
|
||||
test(); // Executes various test cases.
|
||||
|
||||
const int64_t inputSize = 10;
|
||||
|
||||
@@ -72,8 +72,6 @@ void test3() {
|
||||
|
||||
/**
|
||||
* @brief Main function
|
||||
* @param argc commandline argument count (ignored)
|
||||
* @param argv commandline array of arguments (ignored)
|
||||
* @returns 0 on exit
|
||||
*/
|
||||
int main() {
|
||||
|
||||
Reference in New Issue
Block a user