The following PR provides a handful of modifications, from documentation and input validation in order to provide more safety to DataCapture runtime, also fixing data calculations.
About Time Complexity...
It was mentioned that the prior definition of build_stats() was O(2n) instead of O(1n), but which part of the code specifically was establishing such Time Complexity magnitude, is unknown.
To my understanding, the method has a Time Complexity equivalent to O(n) - linear, happening in separate moments:- sort over self.numbers, which is linear + iteration over self.numbers, which is still linear
There's no recursion [O(2n)] or even of a quadratic magnitude [O(n^2)] taking place.
issue
1
Intro
The following PR provides a handful of modifications, from documentation and input validation in order to provide more safety to DataCapture runtime, also fixing data calculations.
About Time Complexity...
It was mentioned that the prior definition ofbuild_stats()
was O(2n) instead of O(1n), but which part of the code specifically was establishing such Time Complexity magnitude, is unknown.To my understanding, the method has a Time Complexity equivalent to O(n) - linear, happening in separate moments:- sort overself.numbers
, which is linear + iteration overself.numbers
, which is still linearThere's no recursion [O(2n)] or even of a quadratic magnitude [O(n^2)] taking place.between()
method is not O(n) anymore :+1: :