Skip to content
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
Open

Doesn't work #1

yuriyzubarev opened this issue Mar 23, 2012 · 1 comment

Comments

@yuriyzubarev
Copy link

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
Copy link
Author

Take a look here: https://gist.github.com/2175049

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

No branches or pull requests

1 participant