Method in collections::tree · TreeMap coil-stdlib

TreeMap::max_key

pub fn max_key(K fallback) -> K
Import
use collections::tree::{TreeMap};
Source: src/collections/tree.hy

Returns the largest key, or fallback when the map is empty.

Called on a TreeMap value as value.max_key(…).

Parameters#

NameType
fallbackK

Returns#

K

Examples#

use collections::tree::{TreeMap};
use tests::assert;
let m: TreeMap<int, bool> = TreeMap::new();
m.insert(4, true);
m.insert(9, true);
assert!(m.max_key(-1) == 9);

See also#

↑ ↓ navigate ↵ open