ajcr / rolling

Computationally efficient rolling window iterators for Python (sum, variance, min/max, etc.)
MIT License
202 stars 8 forks source link

Implement longest increasing subsequence algorithm #1

Open ajcr opened 6 years ago

ajcr commented 6 years ago

It would be interesting to try and implement an algorithm to find the longest increasing subsequence in a sliding window.

Such an approach is described in Albert et al., 2004:

ajcr commented 6 years ago

Actually, there is another algorithm by Chen et al. that computes the value in O( output ) time:

This is (theortically) an improvement on the O ( log log n + output ) approach in the paper above.

Also, the construction looks possibly easier to implement and more practical as it does not rely on Emde Boas trees.