pydatastructs
pydatastructs copied to clipboard
feat: add longest alternating subsequence
References to issue
Resolves #317
Brief description of what was implemented
- Added longest alternating subsequence
- Added longest alternating subsequence tests
Comments
The algorithm works in O(n) using a dp + greedy solution. It does not return the actualy subsequence; instead, it returns only the length.
@czgdp1807 Could you please review this? Changes have been made.