0

Hi, I am having some troubles with a recursive function.

The function needs to get a string as an input. The string contains both symbols and numbers. What the function does is doing some operation on the two children of a node, the node being the operation(+,-,*,/).

The thing is, I need the function to return a double. This couses a problem since I cant just convert the string to a double becouse of the operators.

This is the algoritm:

```
function Evaluate {
if node is an operator(+,-,*,/) then
evaluate the right and left child
apply the operator of the node to the two children
else if the node is a value then
the result is the value
```