Skip to content

Conversation

@S-M-J-I
Copy link
Contributor

@S-M-J-I S-M-J-I commented Oct 11, 2024

  • 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.
  • All new code is formatted with clang-format -i --style=file path/to/your/file.java

@codecov-commenter
Copy link

codecov-commenter commented Oct 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.08%. Comparing base (87030af) to head (88c78f2).
Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5714      +/-   ##
============================================
+ Coverage     67.01%   67.08%   +0.07%     
- Complexity     4539     4556      +17     
============================================
  Files           616      618       +2     
  Lines         17043    17085      +42     
  Branches       3290     3294       +4     
============================================
+ Hits          11421    11462      +41     
  Misses         5167     5167              
- Partials        455      456       +1     

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

@saahil-mahato
Copy link
Contributor

This is missing test case when the maxStack is empty and we attempt to push or pop. Please confirm. Thanks.

@S-M-J-I
Copy link
Contributor Author

S-M-J-I commented Oct 11, 2024

This is missing test case when the maxStack is empty and we attempt to push or pop. Please confirm. Thanks.

Hi. Thanks for the comment. The test case when maxStack is empty and we attempt to pop from it is present as testBlankHandle(). The test case when the maxStack is empty and we attempt to getMaximum() from it is present as testNullMax(). As for the push, the maxStack will not be empty as long as the mainStack has at least one value. Thank you for bringing this to my attention, I will add a test case where we clear the stack and then try to push into it and try to retrive the max value.

Copy link
Member

@siriak siriak left a comment

Choose a reason for hiding this comment

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

We do not add leetcode problems, please add references to other sources if they exist

@S-M-J-I
Copy link
Contributor Author

S-M-J-I commented Oct 13, 2024

We do not add leetcode problems, please add references to other sources if they exist

Hello @siriak, I added another ref for this algorithm.

@S-M-J-I S-M-J-I requested a review from siriak October 13, 2024 04:30
@S-M-J-I
Copy link
Contributor Author

S-M-J-I commented Oct 15, 2024

Hello @siriak, I have made the reference changes as advised. Please let me know your reviews.

@siriak siriak enabled auto-merge (squash) October 22, 2024 18:29
@siriak siriak merged commit 0f8cda9 into TheAlgorithms:master Oct 22, 2024
6 checks passed
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.

4 participants