Skip to content

Instantly share code, notes, and snippets.

@vishesh
Created March 17, 2015 01:39
Show Gist options
  • Select an option

  • Save vishesh/6fc3bf24012443a3ebbb to your computer and use it in GitHub Desktop.

Select an option

Save vishesh/6fc3bf24012443a3ebbb to your computer and use it in GitHub Desktop.
longest increasing subsequence
(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