after finishing while loop,when it wants to quit the recursive( node curr) method,it comes back again to the recursive call(recursive (nod)) in the for loop and it traps in several loops till an exception occurs saying that "index was out of the rang of the array" .
can anyone help please...
public void recursive(Node curr)
{
while ( sour <= source.Length - 2)
{
for (int i = 0; i < curr.ChildNumber; i++)
{
nod = (Node)curr.nextNode[i];
while (source[sour] != nod.CurrentNodeName)
{
continue;
}
sour = sour + 1;
Console.WriteLine(nod.CurrentNodeName);
recursive((Node)nod);
}
sour = sour + 1;
}
}