raj457036 / Simple-Tools

This repo contains simple tools like clock, Calculator, etc.
https://raj457036.github.io/Simple-Tools/
34 stars 11 forks source link

major flow in infix to prefix convertor #5

Closed shubhamistic closed 1 year ago

shubhamistic commented 2 years ago

bro you have a major flow in your infix to prefix convertor

suppose the infix notation is : (A-Z(B+C)/DE)+F the expected prefix result should be : + - A / Z + B C D E F

but through your algorithm it is giving the result : +-AZ/+BCDEF

it is because when you traverse your code again you can see in prefix the same priority operator can be pushed without poping the existing operator so you need to fix this thing.

raj457036 commented 1 year ago

Hello @shubhamistic, I am not very actively developing these tools anymore ( no time sorry 🥲). A PR would have been really appreciated.

Anyway thanks for bringing this up! I have fixed the logic for the preference of the operators and the issue is resolved. closing this for now.