如何用流程图表示递归函数?
我需要在流程图上表示递归函数。 我的问题是我不知道如何指示该函数可以一次在多个元素上调用自身(例如扫描图形的函数)。 有人有什么建议吗?
I need to represent a recursive function on a flow chart.
My problem is that I don't know how to indicate that the function may call itself over multiple elements at a time (think for example to a function which scans graphs).
Someone has any suggestion?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在流程图中,您通常不会为循环之类的内容添加多次调用,您只需指示可以重复调用代码,直到满足条件为止。因此,对于递归函数来说,它是类似的 - 基本情况是常规步骤,递归步骤与循环相同。有关示例,请参阅此。
In a flow chart, you don't normally add multiple invocations for things like loops, you would just indicate that the code may be repetitively called until a condition is met. So, for a recursive function, it would be similar - the base case is a regular step and the recursive step is the same as loop. See this for an example.