Skip to content

Instantly share code, notes, and snippets.

@hwchiu
Created December 12, 2013 10:34
Show Gist options
  • Save hwchiu/7926013 to your computer and use it in GitHub Desktop.
Save hwchiu/7926013 to your computer and use it in GitHub Desktop.
#include<iostream>
using namespace std;
//Write your stack here
int main(){
//Create two stack, one for float number, one for operator.
//Read the file into some buffer.
//Do infix to prefix.
for(int i=strlen(buf)-l;i>=0;i--){
// if it is a float number, push to float stack.
// if it is a operator, match the operator's priority
}
//Do infix to postfix.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment