![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
南遥云
全栈工程师
展开
-
rust leetcode 111 二叉树最小深度
pub fn min_depth(root: Option<Rc<RefCell<TreeNode>>>) -> i32 { fn m_depth(root: &Option<Rc<RefCell<TreeNode>>>) -> i32 { if let Some(node) = root { let r1 = m_depth(&...原创 2022-01-03 09:51:01 · 269 阅读 · 0 评论 -
RUST 实现优先队列 Heap
pub trait Heap<T> { fn heap_len(&self) -> usize; fn heap_less(&self, i: usize, j: usize) -> bool; fn heap_swap(&mut self, i: usize, j: usize); fn heap_push(&mut self, v: T); fn heap_pop(&mut self) -> .原创 2021-12-22 00:32:43 · 409 阅读 · 0 评论