Skip to content

Add SecondMinMax #4432

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
merged 22 commits into from
Oct 1, 2023
Merged

Add SecondMinMax #4432

merged 22 commits into from
Oct 1, 2023

Conversation

BharathSanjeeviT
Copy link
Contributor

Description

This PR provides a feature that contains the Java Program to find second largest / smallest element from the array with the most optimal solution

This PR addresses the Issue #4430

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized it.
  • All filenames are in PascalCase.
  • All functions and variable names follow Java naming conventions.
  • All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.

I have read code of conduct and provided this PR accordingly

Copy link
Member

@vil02 vil02 left a comment

Choose a reason for hiding this comment

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

@BharathSanjeeviT thanks for an interesting contribution. Before we will marge it, I have some remarks.

Please add some proper tests. Good examples to look at:

@vil02 vil02 self-assigned this Sep 29, 2023
@BharathSanjeeviT
Copy link
Contributor Author

Hey @vil02 , Thank you for looking into my contribution and suggesting all the changes. Hope I did correct all those you said 👍

Copy link
Contributor Author

@BharathSanjeeviT BharathSanjeeviT left a comment

Choose a reason for hiding this comment

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

Hope I did solved all the change that you have addressed 👍

Copy link
Member

@vil02 vil02 left a comment

Choose a reason for hiding this comment

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

The logic in findSecondMin and findSecondMax is very similar (basically the type of inequality). Do you see some way to remove duplicated code?

By the way, you can commit suggestions directly just by clicking the Commit suggestion button - this automatically resolves the conversation.

@BharathSanjeeviT
Copy link
Contributor Author

Hey @vil02 , made the changes that you have mentioned and btw i thought Commit Changes would add extra commits, thanks for the information 👍

Copy link
Contributor Author

@BharathSanjeeviT BharathSanjeeviT left a comment

Choose a reason for hiding this comment

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

Made all these changes 👍

Copy link
Member

@vil02 vil02 left a comment

Choose a reason for hiding this comment

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

Sorry for a monster suggestion: sometimes it is easier to express ideas just by writing code.

@BharathSanjeeviT
Copy link
Contributor Author

Hey @vil02 , made the changes that you've suggested 👍

@BharathSanjeeviT
Copy link
Contributor Author

Hey @vil02 , made the changes that you've suggested 👍

Sorry for a monster suggestion: sometimes it is easier to express ideas just by writing code.

The changes you say, actually making me to learn new things, so i should thank you 👍

@BharathSanjeeviT BharathSanjeeviT requested a review from vil02 October 1, 2023 07:38
Copy link
Member

@vil02 vil02 left a comment

Choose a reason for hiding this comment

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

It is really close!

@BharathSanjeeviT
Copy link
Contributor Author

Hey @vil02 , the changes you have suggested are made, hope you merge this PR 👍

@BharathSanjeeviT BharathSanjeeviT requested a review from vil02 October 1, 2023 15:07
vil02 added 2 commits October 1, 2023 17:21
Each variable declaration must be in its own statement.
@vil02 vil02 changed the title [FEAT] : Second Minimum / Maximum Element Finder Add SecondMinMax Oct 1, 2023
@vil02 vil02 enabled auto-merge (squash) October 1, 2023 15:26
@vil02 vil02 merged commit 37b3844 into TheAlgorithms:master Oct 1, 2023
@vil02
Copy link
Member

vil02 commented Oct 1, 2023

@BharathSanjeeviT thanks for your contribution!

@BharathSanjeeviT
Copy link
Contributor Author

Hey @vil02 , Thank you soo much, i loved this process of contributing towards The Algorithms 👍

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