【发布时间】:2015-10-01 19:43:03
【问题描述】:
我有两个简单的功能:
一)
drawRight(x){ // where x is integer
if(x == 0 )
draw();
else{
drawRight(x-1);
doSomething();
drawLeft(x-1);
}
}
b) (与 a) 非常相似)
drawLeft(x){ // where x is integer
if(x == 0 )
draw();
else{
drawRight(x-1);
doSomething2();
drawLeft(x-1);
}
}
我的问题是:如果我调用例如 drawRight(5) 甚至可以绘制流程图吗?我只为自调用递归函数做了流程图,但找不到这个的解决方案。
任何帮助将不胜感激。
【问题讨论】: