CS 201, Fall 2008
Homework Assignment 3
Due: 18:00, January 12, 2009
In this homework assignment, you are supposed to implement a program for manipulating algebraic
expressions of infix, prefix, and postfix forms.
Your implementation should enable one to convert an
expression of one form to another as well as to evaluate the expression.
Your implementation MUST include the following global functions
whose details are given below.
Note that we will use these function prototypes to test your programs.
Thus, you are not allowed to
change the prototypes of these functions. On the other hand, you are free to add as many additional
functions as you would like into your implementation.
// It converts an infix expression exp to its equivalent prefix form.
string infix2prefix( const string exp );
// It converts an infix expression exp to its equivalent postfix form.
string infix2postfix( const string exp );
// It converts a prefix expression exp to its equivalent infix form.
string prefix2infix( const string exp );
// It converts a prefix expression exp to its equivalent postfix form.
string prefix2postfix( const string exp );
// It converts a postfix expression exp to its equivalent infix form.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '09
 SelimAksoy
 const string exp

Click to edit the document details