public override Models.CalculationNode Parse(string expression)
{
var calNode = new Models.CalculationNode();
int i = expression.Length;
char[] x = expression.ToCharArray();
string temp = "";
//Backwards assembly of the tree
//Right Node
while (!IsOperator(x[i]) && i > 0)
{
if (!x[i].Equals(' ')) temp = x[i] + temp;
i--;
}
}
It has been a while since I've used trees and I'm getting an out of bounds exception in the while loop.