(a: &mut [T])
| 9 | use crate::common::max_heap; |
| 10 | |
| 11 | pub fn sort<T>(a: &mut [T]) |
| 12 | where |
| 13 | T: Ord, |
| 14 | { |
| 15 | // 构建最大堆 |
| 16 | max_heap::build_heap(a); |
| 17 | |
| 18 | let mut i = a.len(); |
| 19 | while i > 1 { |
| 20 | i -= 1; |
| 21 | a.swap(0, i); |
| 22 | max_heap::heapify(&mut a[0..i], 0); |
| 23 | } |
| 24 | } |
nothing calls this directly
no test coverage detected