(&self)
| 185 | } |
| 186 | |
| 187 | fn keys(&self) -> Vec<&K> { |
| 188 | if self.is_empty() { |
| 189 | Vec::new() |
| 190 | } else { |
| 191 | let mut queue = Vec::with_capacity(self.size()); |
| 192 | let lo = self.min().unwrap(); |
| 193 | let hi = self.max().unwrap(); |
| 194 | bst::keys(self.root, &mut queue, lo, hi); |
| 195 | queue |
| 196 | } |
| 197 | } |
| 198 | } |
| 199 | |
| 200 | /// insert the element in the subtree rooted at h |