sagivo/algorithms — pull request #23 by delta4d (2014-12-29 15:39:05+00:00)
Title: Add nlogn LIS algorithm

The original n^2 algorithm seems has some mistake, my code returns a better result with length 9 ([0, 1, 3, 4, 5, 6, 7, 8, 9])

I add the nlogn solution of LIS problem, the basic idea of nlogn algorithm is to store the minimum last element with specific length, which is array len[] in the code. As we see len[] is an increasing array, which lead us able to use binary search. The full algorithm is well written in [wikipedia](http://en.wikipedia.org/wiki/Longest_increasing_subsequence#Efficient_algorithms).

I have done some [test](https://gist.github.com/delta4d/e4255049628184e6a34c) which is generated by c++ code I wrote which passed [ZOJ2136](http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2136).