chore: use iwyu on search/**.cpp

This commit is contained in:
realstealthninja
2024-09-13 15:39:30 +05:30
parent 5dd7f82a34
commit 19d136ae0f
6 changed files with 24 additions and 29 deletions

View File

@@ -12,14 +12,13 @@
* algorithm return null ponter, every other cases the algoritm return fom the
* loop.
*/
#include <cassert>
#include <cmath>
#include <cstdint>
#include <cstdint> /// for integral typedefs
#include <cassert> // for assert
#include <cmath> // for floor
#include <cstdint> // for int32_t, uint32_t
#ifdef _MSC_VER
#include <string> // use for MS Visual C++
#else
#include <cstring> // for all other compilers
#include <cstring> // for size_t
#endif
/** Binary Search Algorithm (used by ::struzik_search)\n

View File

@@ -5,11 +5,10 @@
* algorithm](https://en.wikipedia.org/wiki/Fibonacci_search_technique)
*/
#include <iostream>
#include <vector> // for std::vector class
#include <cassert> // for assert
#include <cstdlib> // for random numbers
#include <algorithm> // for sorting
#include <vector> // for vector
#include <cassert> // for assert
#include <cstdlib> // for rand
#include <algorithm> // for find, sort, min, remove

View File

@@ -15,18 +15,14 @@
* @todo fix the program for memory leaks and better structure in C++ and not C
* fashion
*/
#include <cstdlib>
#include <iostream>
#include <cstdlib> // for NULL, malloc
#include <iostream> // for basic_ostream, operator<<, char_traits, basic_os...
#define MAX 6 ///< Determines how much data
#define HASHMAX 5 ///< Determines the length of the hash table
int data[MAX] = {1, 10, 15, 5, 8, 7}; //!< test data
/**
* a one-way linked list
*/
typedef struct list {
int key; //!< key value for node
struct list* next; //!< pointer to next link in the chain
} node, /**< define node as one item list */

View File

@@ -12,10 +12,10 @@
*
* @author [Hashir Niazi](https://github.com/HashirGJ8842)
*/
#include <cassert> /// for assert
#include <cstdint> /// for integral typedefs
#include <iostream> /// for io operations, and std::pair
#include <vector> /// for std::vector
#include <cassert> // for assert
#include <cstdint> // for uint32_t, int32_t
#include <vector> // for vector
#include <utility> // for pair, make_pair, operator==
/** \namespace search
* \brief Algorithms for searching

View File

@@ -25,10 +25,11 @@
* @author [Nitin Sharma](https://github.com/foo290)
*/
#include <cassert> /// for assert
#include <cstdint> /// for integral typedefs
#include <iostream> /// for IO operations
#include <vector> /// for std::vector
#include <cassert> // for assert
#include <cstddef> // for NULL
#include <cstdint> // for uint64_t, uint32_t
#include <iostream> // for basic_ostream, operator<<, cout, char_traits, endl
#include <vector> // for vector
/**
* @namespace search

View File

@@ -2,13 +2,13 @@
* \file
* \brief Search for words in a long textual paragraph.
*/
#include <cassert>
#include <cstdlib>
#include <iostream>
#include <ctype.h> // for tolower
#include <cassert> // for assert
#include <iostream> // for basic_ostream, operator<<, char_traits, cout, endl
#include <string> // for basic_string, operator<<, string, getline
#ifdef _MSC_VER
#include <string> // required for MS Visual C++
#include <string> // for basic_string, operator<<, string, getline
#else
#include <cstring>
#endif
/**