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

Added BalancedParenthesesChecker.cs, NextGreaterElement.cs and ReverseStack.cs #473

Merged
merged 7 commits into from
Oct 3, 2024

Conversation

mohit-gogitter
Copy link
Contributor

@mohit-gogitter mohit-gogitter commented Oct 1, 2024

Description

I have created stack-based utility classes in C# that can be used by other developers in their solutions.
This utility provides commonly used operations related to stacks, which can be beneficial for solving various problems such as expression evaluations, balanced parentheses, or maintaining a history of operations.

These classes can be used to perform below stack-related operations:
Next Greater Element: Given an array, find the next greater element for each element in the array.
Balanced Parentheses Checker: A utility to check whether a given expression has balanced parentheses.
Reverse a Stack: Function to reverse a stack.

CheckList:

  • I have performed a self-review of my code
  • My code follows the style guidelines of this project
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Comments in areas I changed are up to date
  • I have added comments to hard-to-understand areas of my code
  • I have made corresponding changes to the README.md

@siriak
Copy link
Member

siriak commented Oct 1, 2024

Please put separate algorithms in separate classes with descriptive names and check if they are already implemented in the repository

… BalancedParenthesesChecker.cs, NextGreaterElement.cs and ReverseStack.cs
@mohit-gogitter mohit-gogitter changed the title Added StackUtils.cs - This utility provides commonly used operations related to stacks in C# Added BalancedParenthesesChecker.cs, NextGreaterElement.cs and ReverseStack.cs Oct 2, 2024
@mohit-gogitter
Copy link
Contributor Author

@siriak As suggested, i have created separate classes for algorithms and removed redundant code

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.

Please move them to algorithms project because they are not data structures, they only use stack data structure, add tests, and fix Codacy and other build checks

@mohit-gogitter
Copy link
Contributor Author

mohit-gogitter commented Oct 2, 2024

@siriak Moved to Algorithms project, Added Tests, fixed codacy and build issues. Kindly review

Copy link

codecov bot commented Oct 3, 2024

Codecov Report

Attention: Patch coverage is 98.76543% with 1 line in your changes missing coverage. Please review.

Project coverage is 95.04%. Comparing base (cf19352) to head (a6732f9).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
Algorithms/Stack/BalancedParenthesesChecker.cs 97.72% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #473      +/-   ##
==========================================
+ Coverage   94.97%   95.04%   +0.06%     
==========================================
  Files         243      246       +3     
  Lines       10286    10367      +81     
  Branches     1464     1478      +14     
==========================================
+ Hits         9769     9853      +84     
+ Misses        398      395       -3     
  Partials      119      119              

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

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.

Looks good, thanks!

@siriak siriak merged commit 36a7dd6 into TheAlgorithms:master Oct 3, 2024
4 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.

2 participants