akshitagit / CPP

Repository for C++/C codes and algos.
https://github.com/akshitagupta15june
MIT License
493 stars 434 forks source link

Added Longest Increasing Subsequence code #741

Open AvinashYerra opened 1 year ago

AvinashYerra commented 1 year ago

Added Longest Increasing Subsequence code The function then iterates through each element in the input array, comparing it with all preceding elements. If the current element is greater than the preceding element and the LIS length ending at the current element is less than the LIS length ending at the preceding element plus one, the LIS length for the current element is updated.

fixes #739