| This project has been viewed 554
times and was posted by risik09 from Yemen. |
|
| Start date : 03 Jul. 2008, 18:50 |
End date :17 Jul. 2008, 18:50 |
There is 1 registered bid. |
| Project number : 251744 |
Project category:Engineering |
| This project owner has posted 2 projects on Project Posting and selected winners for 1 of them. |
Description : CS352 SS08 Project 1: Application of Stack
Due date: July 6, 2008, 11:59pm, Central time.
Purpose: Practice the use of stack. Help to understand stack, linked list, and expression tree.
Description: For this project, you are asked to check (to see if it’s valid, in particular, paired parenthesizes) and convert any valid infix expression into postfix expression, and then convert postfix into expression tree. Use stack for both conversions. You should implement stack using singly linked list. That is, first implement a singly linked list class (Obviously, you should also have a class for the node), then use this linked list to implement your Stack class.
Your program should accept input from a text file (E.G. testInput.txt. If you accept different names, your program should prompt user to type in the name of input file). The input for your program will be an infix expression (e.g. a*b+d*(c+f), or 3*d*(x+y)), the output will be an expression tree. You can print out the tree level by level from the root to the leaf nodes, then draw the edges manually. You are also asked to show some intermediate results, namely, the content of stack of each step during the conversion from infix to postfix expression. Whenever you process one character of the infix expression, print out the current content of your stack to both console and a text file (E.G. testResult.txt).
What to submit?
1. Source code which could be compiled without errors.
2. An exe file which can be run on Windows or Linux.
3. A sample result of an input which includes the expression tree and the required intermediate results.
Grading criteria:
1. A project with the program failing to compile earns at most 30%.
2. For successfully compiled program:
a. Source code (well commented): 60%
b. Correct and well formatted result: 30%
c. Sample result: 10%
|
Support :
|