问题描述
我想为递归函数创建流程图。但问题是有两行代码调用函数并导致递归。 在代码中它可能看起来很简单
function(array):
if (base case) do: // base case check
return
if (array.length > 1) do:
function(array= elements from 1 to array.length/2) // first call
function(array= elements from array.length/2 to array.length) // second call
但我不知道如何在流程图中显示 我想过做这样的事情:
它看起来没有调用顺序,一般我不知道如果 array.length 检查(第二个检查)是假的,我不知道要显示什么
顺便说一下,我使用的是 https://app.diagrams.net/