sum abstract method

T sum({
  1. required int index_to,
})

Returns the sum up to the given index index_to.

Example: If the tree is built with 1, 2, 3, 4, 5, then sum(4) will return the sum of 1, 2, 3, 4, 5 which is 15.

Implementation

T sum({
  required final int index_to,
});