Post

Longest Increading Subsequence

✅ Longest Increading Sequence

in given array, find the longest increasing subsequence(sorted in increasing order)

Example:

1
2
3
4
5
6
//input
arr= {3, 10, 2, 1, 20}
//output
3
//explanation
{3, 10, 20}
1
2
3
4
5
6
//input
arr= {30, 20, 10}
//output
1
//explanation
{10}, {20}, {30}
1
2
3
4
5
6
//input
arr= {10, 20, 35, 80}
//output
4
//explanation
{10, 20, 35, 80}

⭐️ Keyword

✅ Code

✅ Time complexity

✅ Space complexity

👍🏻 Pros

👎🏻 Cons

💡 Reference

https://gyoogle.dev/blog/algorithm/LIS.html
https://www.geeksforgeeks.org/longest-increasing-subsequence-dp-3/

This post is licensed under CC BY 4.0 by the author.