def set(index, value)
      node = self

      # Traverse the tree to find the right node to add or replace the value.
      while node do
        # Once we have reached a leaf node we can insert or replace the value.
        if node.is_leaf?
          if index >= node.values.size
            node.fatal "Set index (#{index}) larger than values array " +
              "(#{node.values.size})."
          end
          node.values[index] = value
          return
        else
          # Descend into the right child node to add the value to.
          cidx = node.search_child_index(index)
          index -= node.offsets[cidx]
          node = node.children[cidx]
        end
      end

      node.fatal "Could not find proper node to set the value while " +
        "looking for index #{index}"
    end
def set(index, value)
      node = self

      # Traverse the tree to find the right node to add or replace the value.
      while node do
        # Once we have reached a leaf node we can insert or replace the value.
        if node.is_leaf?
          if index >= node.values.size
            node.fatal "Set index (#{index}) larger than values array " +
              "(#{node.values.size})."
          end
          node.values[index] = value
          return
        else
          # Descend into the right child node to add the value to.
          cidx = node.search_child_index(index)
          index -= node.offsets[cidx]
          node = node.children[cidx]
        end
      end

      node.fatal "Could not find proper node to set the value while " +
        "looking for index #{index}"
    end
Set the given value at the given index.
 @param index [Integer] Position to insert at
 @param value [Integer] value to insert