diff --git a/d0/d52/namespacewiggle__sort.html b/d0/d52/namespacewiggle__sort.html new file mode 100644 index 000000000..48556d725 --- /dev/null +++ b/d0/d52/namespacewiggle__sort.html @@ -0,0 +1,112 @@ + + +
+ + + + +|
+ Algorithms_in_C++
+ 1.0.0
+
+ Set of algorithms implemented in C++.
+ |
+
Functions for Wiggle Sort algorithm. +More...
+Functions for Wiggle Sort algorithm.
+|
+ Algorithms_in_C++
+ 1.0.0
+
+ Set of algorithms implemented in C++.
+ |
+
Wiggle Sort Algorithm Implementation +More...
+#include <iostream>#include <algorithm>#include <vector>#include <cassert>#include <ctime>+Namespaces | |
| sorting | |
| Sorting algorithms. | |
| wiggle_sort | |
| Functions for Wiggle Sort algorithm. | |
+Functions | |
| template<typename T > | |
| std::vector< T > | sorting::wiggle_sort::wiggleSort (const std::vector< T > &arr) |
| Function used for sorting the elements in wave form. More... | |
| template<typename T > | |
| static void | displayElements (const std::vector< T > &arr) |
| Utility function used for printing the elements. Prints elements of the array after they're sorted using wiggle sort algorithm. More... | |
| static void | test () |
| int | main () |
Wiggle Sort Algorithm Implementation
+ +Wiggle Sort sorts the array into a wave like array. An array ‘arr[0..n-1]’ is sorted in wave form, if arr[0] >= arr[1] <= arr[2] >= arr[3] <= arr[4] >= …..
+| std::vector<T> sorting::wiggle_sort::wiggleSort | +( | +const std::vector< T > & | +arr | ) | ++ |
Function used for sorting the elements in wave form.
+Checking whether the even indexed elements are greater than their adjacent odd elements. Traversing all even indexed elements of the input arr. If current element is smaller than the previous odd element, swap them. If current element is smaller than the next odd element, swap them.
+| arr | input array (unsorted elements) |
prints the assigned colors using Graph Coloring algorithm
@@ -137,8 +137,8 @@ FunctionsMain function
+Main function
+Driver Code
+
+
|
+ +static | +
Test function
Sorting algorithms.
+for io operations
Sorting Algorithms.
for std::vector
for std::is_sorted, std::swap for assert for io operations
diff --git a/d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html b/d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html index b40238695..1a167058a 100644 --- a/d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html +++ b/d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html @@ -142,7 +142,7 @@ Documentationtest() functions that will invoke the algorithm implementation on random test data with expected output. Use assert() function to confirm that the tests will pass. Requires including the cassert header.|
+ Algorithms_in_C++
+ 1.0.0
+
+ Set of algorithms implemented in C++.
+ |
+