def insert_element(key, value_or_child)
      if @keys.size >= @tree.order
        PEROBS.log.fatal "Cannot insert into a full BTreeNode"
      end

      i = search_key_index(key)
      if @keys[i] == key
        # Overwrite existing entries
        @keys[i] = key
        if is_leaf
          @values[i] = value_or_child
        else
          @children[i + 1] = link(value_or_child)
        end
        @tree.node_cache.insert(self)

        return false
      else
        # Create a new entry
        @keys.insert(i, key)
        if is_leaf
          @values.insert(i, value_or_child)
        else
          @children.insert(i + 1, link(value_or_child))
        end
        @tree.node_cache.insert(self)

        return true
      end
    end
def insert_element(key, value_or_child)
      if @keys.size >= @tree.order
        PEROBS.log.fatal "Cannot insert into a full BTreeNode"
      end

      i = search_key_index(key)
      if @keys[i] == key
        # Overwrite existing entries
        @keys[i] = key
        if is_leaf
          @values[i] = value_or_child
        else
          @children[i + 1] = link(value_or_child)
        end
        @tree.node_cache.insert(self)

        return false
      else
        # Create a new entry
        @keys.insert(i, key)
        if is_leaf
          @values.insert(i, value_or_child)
        else
          @children.insert(i + 1, link(value_or_child))
        end
        @tree.node_cache.insert(self)

        return true
      end
    end
Insert the given value or child into the current node using the key as
 index.
 @param key [Integer] key to address the value or child
 @param value_or_child [Integer or BTreeNode] value or BTreeNode
        reference
 @return true for insert, false for overwrite