Skip to content

Conversation

Prasoon31Pandey
Copy link

This program converts an infix expression (like A+B*C) into a postfix expression (A B C * +) using the Stack data structure. It follows operator precedence and associativity rules to ensure the correct order of operations.

Example:
Input: A+BC
Output: ABC
+

Time Complexity: O(n)
Space Complexity: O(n)

Thanks for submitting a PR, your contribution is really appreciated!

Here's a quick checklist that should be present in PRs:

  • Make sure to include reasonable tests for your change if necessary

  • We use towncrier for changelog management, so please add a news file into the changelog folder following these guidelines:

    • Name it $issue_id.$type for example 588.bugfix;

    • If you don't have an issue_id change it to the PR id after creating it

    • Ensure type is one of removal, feature, bugfix, vendor, doc or trivial

    • Make sure to use full sentences with correct case and punctuation, for example:

      Fix issue with non-ascii contents in doctest text files.
      

This program converts an infix expression (like A+B*C) into a postfix expression (A B C * +)
using the Stack data structure. It follows operator precedence and associativity rules to
ensure the correct order of operations.

Example:
Input:  A+B*C
Output: ABC*+

Time Complexity: O(n)
Space Complexity: O(n)
@webknjaz webknjaz added the spam label Oct 5, 2025
@pytest-dev pytest-dev locked as spam and limited conversation to collaborators Oct 5, 2025
@webknjaz webknjaz closed this Oct 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants