MCPcopy Create free account
hub / github.com/TheAlgorithms/Rust / wave_sort

Function wave_sort

src/sorting/wave_sort.rs:18–25  ·  view source on GitHub ↗

Wave Sort Algorithm Wave Sort is a sorting algorithm that works in O(n log n) time assuming the sort function used works in O(n log n) time. It arranges elements in an array into a sequence where every alternate element is either greater or smaller than its adjacent elements. Reference: [Wave Sort Algorithm - GeeksforGeeks](https://www.geeksforgeeks.org/sort-array-wave-form-2/) # Examples use

(arr: &mut [T])

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 5

test_case_1Function · 0.85
test_case_2Function · 0.85
test_case_3Function · 0.85
test_case_4Function · 0.85
test_case_5Function · 0.85

Calls 1

lenMethod · 0.45

Tested by 5

test_case_1Function · 0.68
test_case_2Function · 0.68
test_case_3Function · 0.68
test_case_4Function · 0.68
test_case_5Function · 0.68