|
Algorithms_in_C++ 1.0.0
Set of 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. More... | |
| uint64_t | LinearSearch (const std::array< uint64_t, N > &dataArr, const uint64_t &val) const |
| Search an element using linear search. More... | |
| uint64_t | search (const uint64_t &val) |
| void | sort () |
| Sort the list. More... | |
| void | insert (const uint64_t &val) |
| Insert the new element in the list. More... | |
| void | remove (const uint64_t &val) |
| To remove the element from the list. More... | |
| void | show () |
| Utility function to print array. More... | |
Public Attributes | |
| std::array< uint64_t, N > | data {} |
| uint64_t | top = 0 |
| bool | isSorted = false |
Structure of List with supporting methods.
|
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 |
|
inline |
Insert the new element in the list.
| val | element that will be inserted |
|
inline |
Search an element using linear search.
| dataArr | list |
| val | element that will be searched |
|
inline |
To remove the element from the list.
| val | element that will be removed |
|
inline |
|
inline |
|
inline |
Sort the list.