Skip to content

Commit 1901732

Browse files
Revert "chore: use iwyu on data_structures/**.cpp"
This reverts commit a3b719e.
1 parent 380127e commit 1901732

30 files changed

+634
-602
lines changed

data_structures/binary_search_tree.cpp

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
* \warning This program is a poor implementation - C style - and does not
77
* utilize any of the C++ STL features.
88
*/
9-
#include <cstddef> // for NULL
10-
#include <iostream> // for operator<<, basic_ostream, char_traits, cout
9+
#include <iostream>
1110

1211
struct node {
1312
int val;
@@ -146,28 +145,28 @@ int main() {
146145
std::cin >> ch;
147146
int x;
148147
switch (ch) {
149-
case 1:
150-
std::cout << "\nEnter the value to be Inserted : ";
151-
std::cin >> x;
152-
Insert(root, x);
153-
break;
154-
case 2:
155-
std::cout << "\nEnter the value to be Deleted : ";
156-
std::cin >> x;
157-
Remove(root, root, x);
158-
break;
159-
case 3:
160-
BFT(root);
161-
break;
162-
case 4:
163-
Pre(root);
164-
break;
165-
case 5:
166-
In(root);
167-
break;
168-
case 6:
169-
Post(root);
170-
break;
148+
case 1:
149+
std::cout << "\nEnter the value to be Inserted : ";
150+
std::cin >> x;
151+
Insert(root, x);
152+
break;
153+
case 2:
154+
std::cout << "\nEnter the value to be Deleted : ";
155+
std::cin >> x;
156+
Remove(root, root, x);
157+
break;
158+
case 3:
159+
BFT(root);
160+
break;
161+
case 4:
162+
Pre(root);
163+
break;
164+
case 5:
165+
In(root);
166+
break;
167+
case 6:
168+
Post(root);
169+
break;
171170
}
172171
} while (ch != 0);
173172

data_structures/binary_search_tree2.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55
* @see binary_search_tree.cpp
66
*/
77

8-
#include <cassert> // for assert
9-
#include <functional> // for function
10-
#include <iostream> // for basic_ostream, operator<<, cout, char_traits
11-
#include <memory> // for operator==, unique_ptr, allocator
12-
#include <vector> // for vector, operator==
13-
#include <cstddef> // for size_t
14-
#include <utility> // for move
8+
#include <cassert>
9+
#include <functional>
10+
#include <iostream>
11+
#include <memory>
12+
#include <vector>
1513

1614
/**
1715
* @brief The Binary Search Tree class.

data_structures/bloom_filter.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,12 @@
2222
* @author [DanArmor](https://github.com/DanArmor)
2323
*/
2424

25-
#include <cassert> // for assert
26-
#include <functional> // for function
27-
#include <initializer_list> // for initializer_list
28-
#include <string> // for basic_string, string
29-
#include <vector> // for vector
30-
#include <iostream> // for operator<<, basic_ostream, cout
31-
#include <cstddef> // for size_t
25+
#include <cassert> /// for assert
26+
#include <functional> /// for list of hash functions for bloom filter constructor
27+
#include <initializer_list> /// for initializer_list for bloom filter constructor
28+
#include <string> /// for testing on strings
29+
#include <vector> /// for std::vector
30+
#include <iostream> /// for IO operations
3231

3332
/**
3433
* @namespace data_structures

data_structures/cll/cll.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
A simple class for Cicular Linear Linked List
33
*/
44
#include "cll.h"
5-
6-
#include <cstdlib> // for NULL
7-
#include <iostream> // for basic_ostream, char_traits, operator<<, cout
8-
95
using namespace std;
106

117
/* Constructor */

data_structures/cll/main_cll.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
#include <iostream> // for basic_ostream, operator<<, char_traits, cout, endl
2-
3-
#include "cll.h" // for cll
4-
1+
#include "cll.h"
52
using namespace std;
63

74
int main() {

data_structures/doubly_linked_list.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
#include <cstdio> // for NULL
2-
#include <iostream> // for operator<<, basic_ostream, cout, char_traits
1+
#include <cstdio>
2+
#include <cstdlib>
3+
#include <iostream>
34

45
struct node {
56
int val;

data_structures/dsu_path_compression.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,10 @@
1818
* @see dsu_union_rank.cpp
1919
*/
2020

21-
#include <cassert> // for assert
22-
#include <cstdint> // for uint64_t
23-
#include <iostream> // for char_traits, basic_ostream, operator<<, cout, endl
24-
#include <vector> // for vector
25-
#include <algorithm> // for max, min
26-
#include <utility> // for swap
21+
#include <cassert> /// for assert
22+
#include <cstdint> /// for integral typedefs
23+
#include <iostream> /// for IO operations
24+
#include <vector> /// for std::vector
2725

2826
using std::cout;
2927
using std::endl;

data_structures/dsu_union_rank.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@
1919
* @see dsu_path_compression.cpp
2020
*/
2121

22-
#include <cassert> // for assert
23-
#include <cstdint> // for uint64_t
24-
#include <iostream> // for char_traits, basic_ostream, operator<<, cout, endl
25-
#include <vector> // for vector
26-
#include <utility> // for swap
22+
#include <cassert> /// for assert
23+
#include <cstdint> /// for integral typedefs
24+
#include <iostream> /// for IO operations
25+
#include <vector> /// for std::vector
2726

2827
using std::cout;
2928
using std::endl;

data_structures/linked_list.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@
1414
* to point to the node that the current node is pointing to, and then returning
1515
* the current node to heap store.
1616
*/
17-
#include <ctype.h> // for isdigit
18-
#include <iostream> // for operator<<, basic_ostream, cout, basic_istream, cin
19-
#include <memory> // for shared_ptr, __shared_ptr_access, make_shared
20-
#include <string> // for char_traits, basic_string, operator>>, stoi, string
17+
#include <iostream>
18+
#include <memory>
19+
#include <string>
2120

2221
/**
2322
* @namespace data_structures

data_structures/list_array.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@
1414
* and print the list.
1515
*/
1616

17-
#include <array> // for array
18-
#include <cassert> // for assert
19-
#include <cstdint> // for uint64_t
20-
#include <iostream> // for operator<<, basic_ostream::operator<<, basic_ost...
21-
#include <utility> // for swap
17+
#include <array> /// for std::array
18+
#include <cassert> /// for assert
19+
#include <cstdint> /// for integral typedefs
20+
#include <iostream> /// for io operations
2221

2322
/**
2423
* @namespace data_structures

0 commit comments

Comments
 (0)