-
Notifications
You must be signed in to change notification settings - Fork 7
Closed
Description
Doing concat on normal js Array has quadratic complexity, plus doing map on the history
is linear.
So I belive complexity this far is O(n^2 + n)
. but this is for nth yield, if i'm correct, using this for some program With n
yield, will have complexity of O(n * (n^2 + n))
i.e. O(n^3+n^2)
. and I think this should be at least noted in readme.
btw the O(n^2 + n)
part could be optimised to O(n)
by using some some sequence structure which has constant time push
(as you push one element only), you could even use normal Lined list for it (List = Nil | Cons a (List a)
). this way complexity for some program With n
yield will be O(n * n)
i.e. O(n^2)
.
Metadata
Metadata
Assignees
Labels
No labels