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

Implement Parentheses Generator using Backtracking Strategy #713

Merged
merged 9 commits into from
May 16, 2024

Conversation

TruongNhanNguyen
Copy link
Contributor

Type of change

  • New feature (non-breaking change which adds functionality)

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 May 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.78%. Comparing base (28be0a3) to head (eaa3919).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #713   +/-   ##
=======================================
  Coverage   94.77%   94.78%           
=======================================
  Files         298      299    +1     
  Lines       22213    22246   +33     
=======================================
+ Hits        21052    21085   +33     
  Misses       1161     1161           

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

src/backtracking/parentheses_generator.rs Outdated Show resolved Hide resolved
src/backtracking/parentheses_generator.rs Outdated Show resolved Hide resolved
src/backtracking/parentheses_generator.rs Outdated Show resolved Hide resolved
src/backtracking/parentheses_generator.rs Outdated Show resolved Hide resolved
@vil02 vil02 merged commit b86b003 into TheAlgorithms:master May 16, 2024
4 checks passed
@TruongNhanNguyen TruongNhanNguyen deleted the backtracking/gen-parents branch May 16, 2024 23:14
TruongNhanNguyen added a commit to TruongNhanNguyen/Rust that referenced this pull request May 20, 2024
…ithms#713)

* chore: add `parentheses_generator.rs` to DIRECTORY.md

* feat: implement Parentheses Generator algorithm

* chore: rename `open` to `open_count`, `close` to `close_count`

* chore: change `u32` to `usize`

* ref: eliminate the need for mutability

* chore: handle case where `n = 0`

* chore: fix typos in docstring

* style: simplify logic

---------

Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
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.

None yet

3 participants