Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancements to "Longest Increasing Subsequence" #209

Merged

Conversation

digital-carver
Copy link
Contributor

Performance improvement: Use pushfirst! directly when creating the result lis_arr instead of unnecessarily doing push! in a loop and then reverse! later

More Julian code: Writing generic code is strongly encouraged in Julia, and it's more in line with Julian convention to accept an array of any Integer subtype, instead of artificially limiting it to Int only. Since where T <: Integer is pretty intuitive and easy to make sense of, it doesn't particularly affect readability. And this makes it clearer which of the arrays used in the function are meant to hold values from the original array (those typed T) and which are meant to hold indices (those typed Int), which can make it easier to understand the algorithms.

Copy link
Collaborator

@uncomfyhalomacro uncomfyhalomacro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@codecov
Copy link

codecov bot commented Oct 26, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b0a4123) 96.15% compared to head (b454e11) 96.15%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #209      +/-   ##
==========================================
- Coverage   96.15%   96.15%   -0.01%     
==========================================
  Files         136      136              
  Lines        1717     1715       -2     
==========================================
- Hits         1651     1649       -2     
  Misses         66       66              
Files Coverage Δ
...rc/longest_increasing_subsequence/binary_search.jl 100.00% <100.00%> (ø)
...gest_increasing_subsequence/dynamic_programming.jl 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@uncomfyhalomacro uncomfyhalomacro merged commit b5269b4 into TheAlgorithms:main Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants