mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-02 04:31:55 +08:00
Sync zh and zh-hant versions (#1801)
* Sync zh and zh-hant versions. * Unifying "数据体量" -> "数据规模".
This commit is contained in:
@ -13,22 +13,12 @@ fn test_push_max(heap: &mut BinaryHeap<i32>, val: i32) {
|
||||
println!("\n元素 {} 入堆積後", val);
|
||||
print_util::print_heap(heap.iter().map(|&val| val).collect());
|
||||
}
|
||||
fn test_push_min(heap: &mut BinaryHeap<Reverse<i32>>, val: i32) {
|
||||
heap.push(Reverse(val)); // 元素入堆積
|
||||
println!("\n元素 {} 入堆積後", val);
|
||||
print_util::print_heap(heap.iter().map(|&val| val.0).collect());
|
||||
}
|
||||
|
||||
fn test_pop_max(heap: &mut BinaryHeap<i32>) {
|
||||
let val = heap.pop().unwrap();
|
||||
println!("\n堆積頂元素 {} 出堆積後", val);
|
||||
print_util::print_heap(heap.iter().map(|&val| val).collect());
|
||||
}
|
||||
fn test_pop_min(heap: &mut BinaryHeap<Reverse<i32>>) {
|
||||
let val = heap.pop().unwrap().0;
|
||||
println!("\n堆積頂元素 {} 出堆積後", val);
|
||||
print_util::print_heap(heap.iter().map(|&val| val.0).collect());
|
||||
}
|
||||
|
||||
/* Driver Code */
|
||||
fn main() {
|
||||
|
||||
Reference in New Issue
Block a user