递归方法是否会增加环图复杂度

Ber*_*Cim 6 recursion complexity-theory

我目前没有安装任何用于测量环码复杂代码的程序.但我想知道递归方法会增加复杂性吗?

例如

// just a simple C# example to recursively find an int[]
// within a pile of string[]
private int[] extractInts(string[] s)
{
    foreach (string s1 in s)
    {
        if (s1.ints.length < 0)
        {
            extractInts(s1);
        }
        else
        {
            return ints;
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

谢谢.

Jav*_*mae 4

据我了解,没有。在您的示例中,递归方法只有一条线性独立的路径,因此它不会增加圈复杂度。