Skip to content

Conversation

@Lownish
Copy link
Contributor

@Lownish Lownish commented Aug 15, 2020

Description of Change

Checklist

  • Added description of change
  • Added file name matches File name guidelines
  • Added tests and example, test must pass
  • Added documentation so that the program is self-explanatory and educational - Doxygen guidelines
  • 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:

@Panquesito7 Panquesito7 added automated tests are failing Do not merge until tests pass enhancement New feature or request labels Aug 15, 2020
@Lownish
Copy link
Contributor Author

Lownish commented Aug 15, 2020

@Panquesito7 , can you please let me know what are the actual issues with the code formatter? I defined everything as per the contribution guidelines.

@rishabh-997
Copy link
Contributor

what are the actual issues with the code formatter?

You are using c-style arrays for initialization. Either use a pointer or replace it with vector

Copy link
Member

@Panquesito7 Panquesito7 left a comment

Choose a reason for hiding this comment

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

Please fix clang-tidy warnings.

@Panquesito7 Panquesito7 added the requested changes changes have been requested label Aug 16, 2020
@Lownish
Copy link
Contributor Author

Lownish commented Aug 16, 2020

Please fix clang-tidy warnings.

The warning is telling to use std::vector on line 34, but it's already std::vector

@Panquesito7
Copy link
Member

but it's already std::vector

It's still wrong, it's a C VLA array, which is not good.
Please use std::vector<> properly.

@kvedala
Copy link
Collaborator

kvedala commented Aug 17, 2020

The repo CI tools build live documentations using doxygen and hence require a certain standard and protocol to be followed.
Please use the code structure similar to the other codes in the folder like this.
Thank you

@Panquesito7 Panquesito7 removed the automated tests are failing Do not merge until tests pass label Aug 17, 2020
Copy link
Member

@Panquesito7 Panquesito7 left a comment

Choose a reason for hiding this comment

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

Looks much better. Good work! 👍
Now, let's add a namespace, to ensure all functions are together.

Let us also improve the code to make refined. 🙂

#include <iostream> //for io operations

/**
*Pigeonhole sorting of array with array size n
Copy link
Member

Choose a reason for hiding this comment

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

Missing parameter and return statement documentation.

Lownish and others added 2 commits August 18, 2020 01:12
 Suggested changes applied Co-authored-by: David Leal <halfpacho@gmail.com>
@lgtm-com

This comment has been minimized.

Lownish and others added 2 commits August 19, 2020 01:11
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
/**
* Pigeonhole sorting of array of size n
* The function will sort the array through Pigeonhole algorithm and print
* @param arr unsorted array of elements
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* @param arr unsorted array of elements
* @param arr unsorted array of elements
* @param n number of times loop will run
Copy link
Collaborator

Choose a reason for hiding this comment

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

n is not needed. isn't it same as the template variable N?
"Number of times loop will run" -> isn't this the number of values in your array?

Co-authored-by: David Leal <halfpacho@gmail.com>
Copy link
Member

@Panquesito7 Panquesito7 left a comment

Choose a reason for hiding this comment

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

Excellent work; LGTM. 👍😄
Thank you for your contribution.

@kvedala please review as well. Thanks.

@Panquesito7 Panquesito7 added approved Approved; waiting for merge and removed requested changes changes have been requested labels Aug 20, 2020
@Panquesito7 Panquesito7 requested a review from kvedala August 20, 2020 17:24
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.

there seem to be some problems in the code. please check the comments. Thank you

/**
* Pigeonhole sorting of array of size n
* The function will sort the array through Pigeonhole algorithm and print
* @param arr unsorted array of elements
Copy link
Collaborator

Choose a reason for hiding this comment

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

n is not needed. isn't it same as the template variable N?
"Number of times loop will run" -> isn't this the number of values in your array?

@kvedala
Copy link
Collaborator

kvedala commented Aug 23, 2020

Any reason to use std::max_element rather than std::max similarly for std::min?

@Lownish
Copy link
Contributor Author

Lownish commented Aug 24, 2020

Any reason to use std::max_element rather than std::max similarly for std::min?

I was getting an error involving incompatible data types. I could overcome this issue through the use of std::max_element

@kvedala
Copy link
Collaborator

kvedala commented Aug 25, 2020

Any reason to use std::max_element rather than std::max similarly for std::min?

I was getting an error involving incompatible data types. I could overcome this issue through the use of std::max_element

got it, std::max_element is for container classes like arrays.

@Lownish Lownish requested a review from kvedala August 25, 2020 16:10
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.

👍 please check the comments

Lownish and others added 2 commits August 25, 2020 23:10
Co-authored-by: Krishna Vedala <7001608+kvedala@users.noreply.github.com>
@Panquesito7 Panquesito7 added the automated tests are failing Do not merge until tests pass label Aug 25, 2020
@Panquesito7 Panquesito7 removed the automated tests are failing Do not merge until tests pass label Aug 25, 2020
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.

👍

@Panquesito7 Panquesito7 merged commit 66dcc4c into TheAlgorithms:master Aug 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Approved; waiting for merge enhancement New feature or request

5 participants