MCPcopy Create free account
hub / github.com/QMHTMY/RustBook / tim_sort

Function tim_sort

publication/code/chapter07/tim_sort.rs:654–661  ·  view source on GitHub ↗

timSort 入口

(list: &mut [i32])

Source from the content-addressed store, hash-verified

652
653// timSort 入口
654fn tim_sort(list: &mut [i32]) {
655 if list.len() < MIN_MERGE {
656 insertion_sort(list);
657 } else {
658 let mut sort_state = SortState::new(list);
659 sort_state.sort();
660 }
661}
662
663fn main() {
664 let mut nums: Vec<i32> = vec![

Callers 1

mainFunction · 0.70

Calls 3

insertion_sortFunction · 0.70
lenMethod · 0.45
sortMethod · 0.45

Tested by

no test coverage detected