mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-02-03 02:25:57 +08:00
chore: use iwyu on search/**.cpp
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user