insert method

void insert(
  1. K key,
  2. V value
)

Inserts a key-value pair. If the key already exists, its value is updated. Time complexity: O(log N).

Implementation

void insert(K key, V value) {
  _container[key] = value;
}