chore: use iwyu on strings/**.cpp

This commit is contained in:
realstealthninja
2024-09-13 15:39:46 +05:30
parent a290ae7ee2
commit f2127456a8
7 changed files with 39 additions and 34 deletions

View File

@@ -42,12 +42,13 @@
* @author [Stoycho Kyosev](https://github.com/stoychoX)
*/
#include <cassert> /// for assert
#include <climits> /// for CHAR_MAX macro
#include <cstring> /// for strlen
#include <iostream> /// for IO operations
#include <string> /// for std::string
#include <vector> /// for std::vector
#include <cassert> // for assert
#include <climits> // for CHAR_MAX
#include <cstring> // for size_t, strlen
#include <iostream> // for operator<<, basic_ostream, cout
#include <string> // for basic_string, string
#include <vector> // for vector
#include <algorithm> // for max
#define APLHABET_SIZE CHAR_MAX ///< number of symbols in the alphabet we use

View File

@@ -2,13 +2,14 @@
* @file
* @brief String pattern search - brute force
*/
#include <iostream>
#include <iostream> // for operator<<, basic_ostream, char_traits, cout
#include <string> // for basic_string, operator==, string, to_string
#ifdef _MSC_VER
#include <string> // use this for MS Visual C++
#include <string> // for basic_string, operator==, string, to_string
#else
#include <cstring>
#include <cstring> // for size_t
#endif
#include <vector>
#include <vector> // for vector, allocator
namespace string_search {
/**

View File

@@ -4,9 +4,10 @@
* @author [Harry Kontakis](https://github.com/ckontakis)
*/
#include <iostream>
#include <unordered_map>
#include <cassert>
#include <unordered_map> // for unordered_map, _Node_iterator_base, operator!=
#include <cassert> // for assert
#include <string> // for basic_string, string
#include <utility> // for pair, make_pair
/**
* @namespace strings

View File

@@ -13,10 +13,11 @@
* @author [Yancey](https://github.com/Yancey2023)
*/
#include <cassert> /// for assert
#include <iostream> /// for IO operations
#include <string> /// for std::string
#include <vector> /// for std::vector
#include <cassert> // for assert
#include <cstddef> // for size_t
#include <iostream> // for operator<<, basic_ostream, cout
#include <string> // for basic_string, string
#include <vector> // for vector
/**
* @namespace string_search

View File

@@ -10,14 +10,15 @@
* @author [Riti Kumari](https://github.com/riti2409)
*/
#include <cassert> /// for assert
#include <cstdint> /// for integral typedefs
#include <iostream> /// for IO operations
#include <vector> /// for std::vector STL
#include <cassert> // for assert
#include <cstdint> // for uint64_t
#include <iostream> // for char_traits, basic_ostream, operator<<, cout, endl
#include <vector> // for allocator, vector
#include <algorithm> // for min
#include <string> // for basic_string, operator==, operator+, string
#ifdef _MSC_VER
#include <string> /// for string (required for MS Visual C++)
#include <string> // for basic_string, operator==, operator+, string
#else
#include <cstring> /// for string
#endif
/**

View File

@@ -4,13 +4,13 @@
* Algorithm](https://en.wikipedia.org/wiki/RabinKarp_algorithm) for finding a
* pattern within a piece of text with complexity O(n + m)
*/
#include <cassert>
#include <cmath>
#include <iostream>
#include <stdint.h> // for int64_t
#include <cassert> // for assert
#include <cmath> // for pow
#include <string> // for basic_string, string
#ifdef _MSC_VER
#include <string> // use this for MS Visucal C++
#include <string> // for basic_string, string
#else
#include <cstring>
#endif
#define PRIME 5 ///< Prime modulus for hash functions

View File

@@ -11,15 +11,15 @@
* @author [Ritika Gupta](https://github.com/RitikaGupta8734)
*/
#include <cstdint> /// for integral typedefs
#include <iostream> /// for IO operations
#include <cstdint> // for uint64_t
#include <algorithm> // for min
#include <string> // for basic_string, string, operator+, char_traits
#ifdef _MSC_VER
#include <string> /// for string (use this for MS Visual C++)
#include <string> // for basic_string, string, operator+, char_traits
#else
#include <cstring> /// for string
#endif
#include <cassert> /// for assert
#include <vector> /// for std::vector
#include <cassert> // for assert
#include <vector> // for vector, allocator, operator==
/**
* @brief Generate the Z-function for the inputted string.