(&self)
| 202 | } |
| 203 | |
| 204 | fn min(&self) -> (Option<&T>, Option<&U>) { |
| 205 | // 最小值一定在最左侧 |
| 206 | match &self.left { |
| 207 | Some(node) => node.min(), |
| 208 | None => match &self.key { |
| 209 | Some(key) => (Some(&key), self.val.as_ref()), |
| 210 | None => (None, None), |
| 211 | }, |
| 212 | } |
| 213 | } |
| 214 | |
| 215 | fn max(&self) -> (Option<&T>, Option<&U>) { |
| 216 | // 最大值一定在最右侧 |
no outgoing calls
no test coverage detected