Algorithms_in_C++
1.0.0
Set of algorithms implemented in C++.
|
Implementation of gnome sort algorithm. More...
#include <algorithm>
#include <array>
#include <cassert>
#include <iostream>
Namespaces | |
sorting | |
Sorting algorithms. | |
Functions | |
template<typename T > | |
void | sorting::gnomeSort (T *arr, int size) |
template<typename T , size_t size> | |
std::array< T, size > | sorting::gnomeSort (std::array< T, size > arr) |
static void | test () |
int | main () |
Implementation of gnome sort algorithm.
The time Complexity of the algorithm is \(O(n^2)\) and in some cases it can be \(O(n)\).
int main | ( | void | ) |
Our main function with example of sort method.
|
static |
Test function