Skip to content

Commit 24af4d6

Browse files
Merge branch 'master' into ctest
2 parents 488daec + e9caade commit 24af4d6

34 files changed

+65
-104
lines changed

CMakeLists.txt

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,30 +30,30 @@ if(USE_OPENMP)
3030
endif()
3131
endif()
3232

33-
add_subdirectory(math)
34-
add_subdirectory(others)
35-
add_subdirectory(search)
36-
add_subdirectory(ciphers)
37-
add_subdirectory(hashing)
38-
add_subdirectory(strings)
39-
add_subdirectory(sorting)
40-
add_subdirectory(geometry)
41-
add_subdirectory(graphics)
42-
add_subdirectory(probability)
4333
add_subdirectory(backtracking)
4434
add_subdirectory(bit_manipulation)
35+
add_subdirectory(ciphers)
36+
add_subdirectory(cpu_scheduling_algorithms)
37+
add_subdirectory(data_structures)
38+
add_subdirectory(divide_and_conquer)
4539
add_subdirectory(dynamic_programming)
40+
add_subdirectory(games)
41+
add_subdirectory(geometry)
42+
add_subdirectory(graph)
43+
add_subdirectory(graphics)
4644
add_subdirectory(greedy_algorithms)
47-
add_subdirectory(range_queries)
48-
add_subdirectory(operations_on_datastructures)
49-
add_subdirectory(data_structures)
45+
add_subdirectory(hashing)
5046
add_subdirectory(machine_learning)
47+
add_subdirectory(math)
5148
add_subdirectory(numerical_methods)
52-
add_subdirectory(graph)
53-
add_subdirectory(divide_and_conquer)
54-
add_subdirectory(games)
55-
add_subdirectory(cpu_scheduling_algorithms)
49+
add_subdirectory(operations_on_datastructures)
50+
add_subdirectory(others)
5651
add_subdirectory(physics)
52+
add_subdirectory(probability)
53+
add_subdirectory(range_queries)
54+
add_subdirectory(search)
55+
add_subdirectory(sorting)
56+
add_subdirectory(strings)
5757

5858
cmake_policy(SET CMP0054 NEW)
5959
cmake_policy(SET CMP0057 NEW)

CONTRIBUTING.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,9 @@ static void test() {
204204
205205
/**
206206
* @brief Main function
207-
* @param argc commandline argument count (ignored)
208-
* @param argv commandline array of arguments (ignored)
209207
* @returns 0 on exit
210208
*/
211-
int main(int argc, char *argv[]) {
209+
int main() {
212210
test(); // run self-test implementations
213211
// code here
214212
return 0;

ciphers/uint256_t.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class uint256_t {
7272
*/
7373
template <typename T, typename = typename std::enable_if<
7474
std::is_integral<T>::value, T>::type>
75-
explicit uint256_t(T low) : s(low), f(0) {}
75+
explicit uint256_t(T low) : f(0), s(low) {}
7676

7777
/**
7878
* @brief Parameterized constructor

data_structures/queue_using_array2.cpp

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
#include <iostream>
2-
using namespace std;
32

43
int queue[10];
54
int front = 0;
65
int rear = 0;
76

87
void Enque(int x) {
98
if (rear == 10) {
10-
cout << "\nOverflow";
9+
std::cout << "\nOverflow";
1110
} else {
1211
queue[rear++] = x;
1312
}
1413
}
1514

1615
void Deque() {
1716
if (front == rear) {
18-
cout << "\nUnderflow";
17+
std::cout << "\nUnderflow";
1918
}
2019

2120
else {
22-
cout << "\n" << queue[front++] << " deleted";
21+
std::cout << "\n" << queue[front++] << " deleted";
2322
for (int i = front; i < rear; i++) {
2423
queue[i - front] = queue[i];
2524
}
@@ -30,21 +29,21 @@ void Deque() {
3029

3130
void show() {
3231
for (int i = front; i < rear; i++) {
33-
cout << queue[i] << "\t";
32+
std::cout << queue[i] << "\t";
3433
}
3534
}
3635

3736
int main() {
3837
int ch, x;
3938
do {
40-
cout << "\n1. Enque";
41-
cout << "\n2. Deque";
42-
cout << "\n3. Print";
43-
cout << "\nEnter Your Choice : ";
44-
cin >> ch;
39+
std::cout << "\n1. Enque";
40+
std::cout << "\n2. Deque";
41+
std::cout << "\n3. Print";
42+
std::cout << "\nEnter Your Choice : ";
43+
std::cin >> ch;
4544
if (ch == 1) {
46-
cout << "\nInsert : ";
47-
cin >> x;
45+
std::cout << "\nInsert : ";
46+
std::cin >> x;
4847
Enque(x);
4948
} else if (ch == 2) {
5049
Deque();

data_structures/sparse_table.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,9 @@ static void test() {
155155

156156
/**
157157
* @brief Main function
158-
* @param argc commandline argument count (ignored)
159-
* @param argv commandline array of arguments (ignored)
160158
* @returns 0 on exit
161159
*/
162-
int main(int argc, char *argv[]) {
160+
int main() {
163161
test(); // run self-test implementations
164162
return 0;
165163
}

data_structures/stack_using_array.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Stack {
2525
*
2626
* @param size Maximum size of the stack
2727
*/
28-
Stack(int size) : stackSize(size), stackIndex(-1), stack(new T[size]) {}
28+
Stack(int size) : stack(new T[size]), stackSize(size), stackIndex(-1) {}
2929

3030
/**
3131
* @brief Checks if the stack is full

data_structures/tree_234.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ class Node {
3939
* @param item the first value we insert to the node
4040
*/
4141
explicit Node(int64_t item)
42-
: count(1),
43-
items({{item, 0, 0}}),
44-
children({{nullptr, nullptr, nullptr, nullptr}}) {}
42+
: items({{item, 0, 0}}),
43+
children({{nullptr, nullptr, nullptr, nullptr}}),
44+
count(1) {}
4545

4646
/**
4747
* @brief Get the item count that current saved in the node
@@ -1291,8 +1291,8 @@ static void test2(int64_t n) {
12911291

12921292
/**
12931293
* @brief Main function
1294-
* @param argc commandline argument count (ignored)
1295-
* @param argv commandline array of arguments (ignored)
1294+
* @param argc commandline argument count
1295+
* @param argv commandline array of arguments
12961296
* @returns 0 on exit
12971297
*/
12981298
int main(int argc, char *argv[]) {

dynamic_programming/fibonacci_bottom_up.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ int fib(int n) {
1111
}
1212
return res[1];
1313
}
14-
int main(int argc, char const *argv[]) {
14+
int main() {
1515
int n;
1616
cout << "Enter n: ";
1717
cin >> n;

dynamic_programming/longest_increasing_subsequence.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,9 @@ static void test() {
7474

7575
/**
7676
* @brief Main function
77-
* @param argc commandline argument count (ignored)
78-
* @param argv commandline array of arguments (ignored)
7977
* @returns 0 on exit
8078
*/
81-
int main(int argc, char const *argv[]) {
79+
int main() {
8280
uint32_t n = 0;
8381

8482
std::cout << "Enter size of array: ";

dynamic_programming/longest_increasing_subsequence_nlogn.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ int LIS(const std::vector<int>& arr, int n) {
2929
}
3030
return active.size(); // size of the LIS.
3131
}
32-
int main(int argc, char const* argv[]) {
32+
int main() {
3333
int n;
3434
cout << "Enter size of array: ";
3535
cin >> n;

0 commit comments

Comments
 (0)