krymen / lis

Longest increasing subsequence implementation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Longest increasing subsequence

This is the list of random numbers: [1, 9, 5, 13, 3, 11, 7, 15, 2, 10, 6, 14, 4, 12, 8, 16]

Remove items from the list in such a way that the rest items were sorted ascending and the list was as long as possible.

The solution for the above array is: [1, 3, 7, 10, 12, 16]

The implementation should:

  • be a function, take an array and return an array
  • not use external modules
  • be implemented in node.js

Solution based on Wikipedia.

About

Longest increasing subsequence implementation

License:MIT License


Languages

Language:JavaScript 100.0%