Skip to content

Improve All Combinations of Size k Implementation #782

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

Merged

Conversation

sozelfist
Copy link
Contributor

Checklist:

  • I ran bellow commands using the latest version of rust nightly.
  • I ran cargo clippy --all -- -D warnings just before my last commit and fixed any issue that was found.
  • I ran cargo fmt just before my last commit.
  • I ran cargo test just before my last commit and all tests passed.
  • I added my algorithm to the corresponding mod.rs file within its own folder, and in any parent folder(s).
  • I added my algorithm to DIRECTORY.md with the correct link.
  • I checked COUNTRIBUTING.md and my code follows its guidelines.

@codecov-commenter
Copy link

codecov-commenter commented Aug 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.07%. Comparing base (44270b7) to head (d627b23).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #782      +/-   ##
==========================================
- Coverage   95.07%   95.07%   -0.01%     
==========================================
  Files         309      309              
  Lines       22779    22770       -9     
==========================================
- Hits        21658    21649       -9     
  Misses       1121     1121              

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

@sozelfist
Copy link
Contributor Author

Can you have a look, @vil02?

- The recursion starts from `start = 0`, so it aligns with zero-indexing.
- Pre-allocate `current` vector and using index to track position to avoid unnecessary heap allocations during each recursive call
@sozelfist sozelfist requested a review from vil02 September 7, 2024 02:56
@vil02 vil02 merged commit 28dda98 into TheAlgorithms:master Sep 7, 2024
4 checks passed
@sozelfist sozelfist deleted the backtracking/all_combinations_of_size_k branch September 8, 2024 07:52
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.

3 participants