I'm looking at a book called 'Data Structure (Cheonin Gukje)', which is easy to learn with C.
In the tree chapter, there is an example of a mathematical tree calculation program.
It's as follows
I don't understand the return 0; processing indicated above.
If it was to create an exception, I probably made an exception handling block separately, but why did I write return 0; at the end... I have a question.
Does anyone have any idea what he meant?
Please give us your opinion!
The question says return 0 with the asterisk, but I can't see the asterisk in the question. Do you mean return 0 in the last line of the evaluate function?
The return 0 at the end of the evaluate function means to return 0 when all of the above conditions are not established (i.e., incorrect input).
For example, if root->data is not one of +-*/.
© 2022 pinfo. All rights reserved.