Numeric and sorting algorithms demonstrating function group docs. More...
#include <algorithm>#include <cstdint>#include <numeric>#include <vector>Go to the source code of this file.
Namespaces | |
| namespace | algorithms |
Functions | |
| template<typename T> | |
| void | algorithms::bubble_sort (std::vector< T > &data) |
| Sort a vector in-place using bubble sort. | |
| std::uint64_t | algorithms::fibonacci (unsigned n) |
| Compute the \(n\)-th Fibonacci number. | |
| unsigned | algorithms::gcd (unsigned a, unsigned b) |
| Compute the greatest common divisor of two integers. | |
| template<typename T> | |
| void | algorithms::insertion_sort (std::vector< T > &data) |
| Sort a vector in-place using insertion sort. | |
| bool | algorithms::is_prime (unsigned n) |
| Test whether a number is prime. | |
| template<typename T> | |
| T | algorithms::sum (const std::vector< T > &data) |
| Compute the sum of all elements in a range. | |
Numeric and sorting algorithms demonstrating function group docs.
Exercises Doxygen's @defgroup for free functions, complexity annotations with MathJax, cross-references, and inline source browsing.
Definition in file algorithms.hpp.