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

Doesn't work #1

Open
yuriyzubarev opened this Issue Mar 23, 2012 · 1 comment

Comments

Projects
None yet
1 participant
@yuriyzubarev

yuriyzubarev commented Mar 23, 2012

Try this and you will see:

assert infix_to_prefix("a+b") == "ab+"
assert infix_to_prefix("(a+(b*c))") == "abc*+"
assert infix_to_prefix("((a+b)*(z+x))") == "ab+zx+*"
assert infix_to_prefix("((a+t)*((b+(a+c))^(c+d)))") == "at+bac++cd+^*"
assert infix_to_prefix("c+d*b/(a-e)^b^c") == "cdb*ae-bc^^/+"

First of all parsing is not problem free. Once you get passed it, the algorithm itself is flawed.

Your work is referenced from Wikipedia, you better fix it up :)

@yuriyzubarev

This comment has been minimized.

Show comment
Hide comment
@yuriyzubarev

yuriyzubarev commented Mar 23, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment