Skip to content

Instantly share code, notes, and snippets.

@hwchiu
Created December 12, 2013 10:27
Show Gist options
  • Save hwchiu/7925929 to your computer and use it in GitHub Desktop.
Save hwchiu/7925929 to your computer and use it in GitHub Desktop.
DS Homework 2

##DS Homework2##

####Step 1####

  • Create your stack object, which can be instanced by float or char.
  • You can use template to implement or write two codes.
  • you stack must provide (push,pop,isempty).

####Step 2####

  • Do infix to prefix.
  • Refer this (http://www.youtube.com/watch?v=fUxnb5eTRS0)
  • Read the input string
  • Distinct the float number and operator(+,-,*,/) in input string opposite.
  • Use the stack you write to print the prefix order.

####Step 3####

  • Do infix to postfix.
  • Refer this (http://www.youtube.com/watch?v=fUxnb5eTRS0)
  • Read the input string
  • Distinct the float number and operator(+,-,*,/) in input string .
  • Use the stack you write to print the postfix order anc calculate the sum.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment