You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, In the data_structures/stacks/infix_to_postfix_conversion.py file, when we pass "2^3^2" argument to the infix_to_postfix function, it should return '2 3 2 ^ ^' back. This results in number 512 which is the correct calculation.
Actual behavior
Currently infix_to_postfix("2^3^2") returns '2 3 ^ 2 ^' which is wrong. If we calculate it, it returns number 64.
The reason behind this is that currently we don't have any check for the "associativity" of the operators. In particular ^ operator causes problem here. It has Right-To-Left associativity.