gpc icon indicating copy to clipboard operation
gpc copied to clipboard

O(n^3) time worst-case

Open noughtmare opened this issue 1 year ago • 0 comments

I think it is possible to make the algorithm have O(n^3) worst-case time complexity.

This is not a priority for me, because it probably requires O(n^3) space as well and both those time and space complexity is not really acceptable.

But it might still be interesting to see if it is possible.

Also, it is probably impossible to do this for arbitrary monadic parsers, but I think there is a subset of monadic parsers that can run in O(n^3) time in the worst case. That subset may be the parsers that only use the monadically bound variables to determine whether to fail or proceed.

noughtmare avatar Jun 12 '23 11:06 noughtmare