Help on an algorithm!!!
Posted on 1997-04-22
I am a C beginner. I am doing a program on a math expression
evalutation. In the program, I will input a math. expression like 2+3*5-5 in "stdin". First, I want to evaluate and the value for that expression ,which suppose return 12 as the answer. Second, I want to construct an expression tree for this expression tree. I know to put it vertically will be quite difficult! So I tried a horizontalone. Which it should look like this.
However, since I am a C beginner and this is my first time write a C program dealing with the tree building stuff. I really a difficult job for me. I know the hard part of this program is to got the tree format done first. And I am working on that, however, every time I run the program , my computer just halt. I wonder there may be something wrong with the pointer initiate on my program.
So if there are any C expert can help me with this program, I will highly appreciate. Since I am just a beginner, if you write the code,can you please write more specified so I won't have difficult to understand.
I really want to develop my programming skill on C and its
algorithm. I am looking for a C book that can guide me on those area. Also, if someone know there are some good C books teach me how to bulid trees and other algorithm in C, just let me know. I will highly appreciate !!!
A C beginner