Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@kaloa2025
Copy link
Contributor

Summary

This pull request adds a complete implementation of Infix to Postfix Conversion along with Postfix Expression Evaluation to the Algorithms.Stack namespace.

Included in this PR:

  • Conversion from infix expression → postfix expression using a stack
  • Evaluation of postfix expressions with support for operators: +, -, *, /, ^
  • Proper validation for:
    • Invalid characters
    • Mismatched parentheses
    • Insufficient operands
    • Division by zero
  • XML documentation for clarity and educational value
  • NUnit test cases covering valid expressions, invalid expressions, operator precedence, and edge cases

This algorithm is a classic application of stacks and fits perfectly under the existing Algorithms.Stack category in this repository.


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 feature works
  • New and existing unit tests pass locally with my changes

@kaloa2025 kaloa2025 requested a review from siriak as a code owner November 13, 2025 08:00
@codecov
Copy link

codecov bot commented Nov 13, 2025

Codecov Report

❌ Patch coverage is 98.26087% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.93%. Comparing base (52e4ef3) to head (cd381b9).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
Algorithms/Stack/InfixToPostfix.cs 98.26% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master     #577    +/-   ##
========================================
  Coverage   96.93%   96.93%            
========================================
  Files         297      298     +1     
  Lines       12287    12402   +115     
  Branches     1781     1804    +23     
========================================
+ Hits        11910    12022   +112     
- Misses        239      240     +1     
- Partials      138      140     +2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@siriak
Copy link
Member

siriak commented Nov 13, 2025

Please check the test coverage of your code in Codacy

@siriak siriak enabled auto-merge (squash) November 14, 2025 10:34
@siriak
Copy link
Member

siriak commented Nov 14, 2025

Please check once more, there are a few lines not fully covered
image

@siriak siriak disabled auto-merge November 14, 2025 10:36
@siriak siriak merged commit 8e6d6b7 into TheAlgorithms:master Nov 14, 2025
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