Created
March 17, 2015 01:39
-
-
Save vishesh/6fc3bf24012443a3ebbb to your computer and use it in GitHub Desktop.
longest increasing subsequence
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (define (seq lst last) | |
| (if (empty? lst) | |
| 0 | |
| (if (< last (first lst)) | |
| (max (add1 (seq (rest lst) (first lst))) | |
| (seq (rest lst) last)) | |
| (seq (rest lst) last)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment