|  | 
|  | 
| вернуться в форум | test #5 can anyone tell me what is the 'problem' with test #5, because I get stack overflow, although I don't declare any local variables in my recursive function (I use a vector to simulate the stack)Re: test #5 I have the same problem ,first!but I find that test#5 may be not a tree!
 for example:
 3
 0 1 1
 1 0 1
 1
 0 1
 so you should use array to record whether a node have been in the stack.
Re: test #5 sorry:the example is
 4
 0 1 1
 1 2 1
 2 0 1
 1
 0 1
Re: test #5 Послано BZz13  10 янв 2017 14:55But your example is not a tree... there are cicle...Re: test #5 Ancorrect test | 
 | 
|