TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
|
Implementation of the Wave sort algorithm. More...
#include <algorithm>
#include <cassert>
#include <iostream>
#include <vector>
Go to the source code of this file.
Namespaces | |
namespace | sorting |
for working with vectors | |
namespace | wave_sort |
Functions for the Wave sort implementation. | |
Functions | |
template<typename T > | |
std::vector< T > | sorting::wave_sort::waveSort (const std::vector< T > &in_arr, int64_t n) |
The main function implements that implements the Wave Sort algorithm. | |
static void | test () |
Self-test implementations. | |
int | main () |
Main function. | |
Implementation of the Wave sort algorithm.
Wave Sort is a sorting algorithm that works in \(O(nlogn)\) time assuming the sort function used works in \(O(nlogn)\) time.
Definition in file wave_sort.cpp.
int main | ( | void | ) |
|
static |
Self-test implementations.
Definition at line 53 of file wave_sort.cpp.
std::vector< T > sorting::wave_sort::waveSort | ( | const std::vector< T > & | in_arr, |
int64_t | n ) |
The main function implements that implements the Wave Sort algorithm.
T | type of array |
in_arr | array to be sorted |
Definition at line 34 of file wave_sort.cpp.