TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
|
Structure of List with supporting methods. More...
Public Member Functions | |
uint64_t | BinarySearch (const std::array< uint64_t, N > &dataArr, const uint64_t &first, const uint64_t &last, const uint64_t &val) |
Search an element in the list using binarySearch. | |
uint64_t | LinearSearch (const std::array< uint64_t, N > &dataArr, const uint64_t &val) const |
Search an element using linear search. | |
uint64_t | search (const uint64_t &val) |
void | sort () |
Sort the list. | |
void | insert (const uint64_t &val) |
Insert the new element in the list. | |
void | remove (const uint64_t &val) |
To remove the element from the list. | |
void | show () |
Utility function to print array. | |
Public Attributes | |
std::array< uint64_t, N > | data {} |
uint64_t | top = 0 |
bool | isSorted = false |
Structure of List with supporting methods.
Definition at line 37 of file list_array.cpp.
|
inline |
Search an element in the list using binarySearch.
dataArr | list |
first | pointer to the first element in the remaining list |
last | pointer to the last element in the remaining list |
val | element that will be searched |
Definition at line 49 of file list_array.cpp.
|
inline |
Insert the new element in the list.
val | element that will be inserted |
Definition at line 143 of file list_array.cpp.
|
inline |
Search an element using linear search.
dataArr | list |
val | element that will be searched |
Definition at line 80 of file list_array.cpp.
|
inline |
To remove the element from the list.
val | element that will be removed |
Definition at line 183 of file list_array.cpp.
|
inline |
Definition at line 97 of file list_array.cpp.
|
inline |
Utility function to print array.
Definition at line 203 of file list_array.cpp.
|
inline |
Sort the list.
Definition at line 121 of file list_array.cpp.
std::array<uint64_t, N> data_structures::list_array::list< N >::data {} |
Definition at line 38 of file list_array.cpp.
bool data_structures::list_array::list< N >::isSorted = false |
Definition at line 40 of file list_array.cpp.
uint64_t data_structures::list_array::list< N >::top = 0 |
Definition at line 39 of file list_array.cpp.