BTreeMap.insert

Inserts the (key, value) in the tree. This is passing the copy of the value into the tree, so it's not necessary to manually create copy of it. Note that for the reference types, this will just copy the reference.

  1. bool insert(KeyType key, ValueType value)
    struct BTreeMap(TreeKeyType, TreeValueType, int tree_degree)
  2. ValueType* insert(KeyType key, ValueType value, bool added)

Parameters

key KeyType

key to insert

value ValueType

value associated to the key to insert.

Return Value

Type: bool

true if the element with the given key did not exist and it was inserted, false otherwise

Complexity: CPU: O(degree * log_degree(n)) Memory:O(log_degree(n))

Meta