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

[fix/docs]: Update backtracking folder #916

Merged
merged 68 commits into from
Aug 7, 2020

Conversation

Panquesito7
Copy link
Member

@Panquesito7 Panquesito7 commented Jun 26, 2020

Description of Change

  • Add backtracking folder to CMake build-chain
  • Update various files in the backtracking folder with refined code and documentation

Checklist

  • Added description of change
  • Relevant documentation/comments is changed or added
  • PR title follows semantic commit guidelines
  • Search previous suggestions before making a new one, as yours may be a duplicate.
  • I acknowledge that all my contributions will be made under the project's license.

Notes: Didn't split commits. If requested, I can split, but will take more time.

@kvedala
Copy link
Collaborator

kvedala commented Jun 26, 2020

Too many files and a lot of corrections will come.
If we pick one file at a time, we can do a much better job in improving the code.
Too many files will make the process extremely inefficient.

@Panquesito7 Panquesito7 changed the title [fix/docs]: Update the backtracking folder [fix/docs]: Update backtracking/graph_coloring.cpp Jun 26, 2020
@Panquesito7
Copy link
Member Author

Panquesito7 commented Jun 26, 2020

Done, only updated backtracking/graph_coloring. 🙂

@kvedala
Copy link
Collaborator

kvedala commented Jun 27, 2020

excellent. I see good update.

  1. fix documentation in this code
  2. you'd need to let CMake know about this folder. This requires following steps:
    1. copy CMakeLists.txt (do not change to small-caps) exactly from math folder and paste it in backtracking folder
    2. on line# 16, change destination folder from bin/math to bin/backtracking
    3. open CMakeLists.txt in root folder, add the following line between probability and data_structures.
add_subdirectory(backtracking)

Done. Commit and push. We will ensure the compilation works well.
You can use the link: https://gitpod.io/#https://github.com/TheAlgorithms/C-Plus-Plus/pull/916 to compile the code online and even compile the documentation and view it to ensure all is well.

@Panquesito7
Copy link
Member Author

Done.

@kvedala
Copy link
Collaborator

kvedala commented Jun 27, 2020

now starts your bug-fixing process 😏

@kvedala
Copy link
Collaborator

kvedala commented Jun 27, 2020

As an active contributor, request to you:
use the link above and execute the program, check the output on gitpod. If the output is ok, then implement them as self-tests

@lgtm-com
Copy link

lgtm-com bot commented Jun 27, 2020

This pull request introduces 1 alert when merging 6db5bfa into eddda4e - view on LGTM.com

new alerts:

  • 1 for Short global name

@Panquesito7
Copy link
Member Author

I didn't figured out how to compile it there.
So, I compiled it on my machine with VS 2019.

The results are:

Following are the assigned colors
1232
Following are the assigned colors
1323
Following are the assigned colors
2131
Following are the assigned colors
2313
Following are the assigned colors
3121
Following are the assigned colors
3212

Is that correct? I got a bit confused.

@kvedala
Copy link
Collaborator

kvedala commented Jun 28, 2020

Screen Shot 2020-06-27 at 10 11 00 PM
The errors reported are in a different file. So, next, fix that file in this same Pull-request

@Panquesito7
Copy link
Member Author

Issues should be solved now, thanks! 🙂

@lgtm-com
Copy link

lgtm-com bot commented Jun 28, 2020

This pull request introduces 1 alert when merging 5138881 into f87bc25 - view on LGTM.com

new alerts:

  • 1 for Short global name

@kvedala
Copy link
Collaborator

kvedala commented Jun 29, 2020

This pull request introduces 1 alert when merging 5138881 into f87bc25 - view on LGTM.com

new alerts:

  • 1 for Short global name

please remove global variables. Pass variables as function arguments or better, organize them as private members of a class

@kvedala
Copy link
Collaborator

kvedala commented Jun 29, 2020

please avoid force-push.

@kvedala kvedala changed the title [fix/docs]: Update backtracking/graph_coloring.cpp [fix/docs]: Update backtracking folder Jun 29, 2020
kvedala and others added 4 commits June 29, 2020 19:05
Note: This is identical to passing it as a function parameter, and may not be helpful
make the code neat and clean without global variables
@kvedala
Copy link
Collaborator

kvedala commented Aug 1, 2020

Looks much better. Now, check and fix the documentations for function parameters in kignt's tour program.

@Panquesito7
Copy link
Member Author

fix the documentations for function parameters

Updated. Please review the file.

@Panquesito7 Panquesito7 removed the automated tests are failing Do not merge until tests pass label Aug 2, 2020
*
* @details
* Sudoku (数独, sūdoku, digit-single) (/suːˈdoʊkuː/, /-ˈdɒk-/, /sə-/, originally called
* Number Place)[1] is a logic-based,[2][3] combinatorial[4] number-placement puzzle.
Copy link
Collaborator

@kvedala kvedala Aug 2, 2020

Choose a reason for hiding this comment

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

There are many sudoku solving algorithms. Which method is this?
I think it is the brute-force method.

The wikipedia copy paste is unnecessary here - and is called plagiarism if not cited properly.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point; what kind of description shall we add here?

@kvedala
Copy link
Collaborator

kvedala commented Aug 2, 2020

fix the documentations for function parameters

Updated. Please review the file.

Please check the other files for similar issues.

Copy link
Collaborator

@kvedala kvedala left a comment

Choose a reason for hiding this comment

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

  1. review my comment above: [fix/docs]: Update backtracking folder #916 (comment)
  2. some of the function documentations in sudoku solver are still stubs.

* @param mat matrix where numbers are saved
* @param i current index in rows
* @param j current index in columns
* @param no number to be added in matrix
Copy link
Member Author

@Panquesito7 Panquesito7 Aug 3, 2020

Choose a reason for hiding this comment

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

I think this is the only thing that is missing good documentation.

     * @param no number to be added in matrix

Is there anything else that needs to be changed/fixed?

@Panquesito7 Panquesito7 added the Improvement improvement in previously written codes label Aug 3, 2020
@Panquesito7
Copy link
Member Author

@kvedala all seems to be fine to me (except the review comment above).
What if we merge this, and continue working on it in another PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Approved; waiting for merge Improvement improvement in previously written codes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants