Control flow graph & cyclometric complexity for folowing procedure

Posted by softyGuy on Stack Overflow See other posts from Stack Overflow or by softyGuy
Published on 2010-04-19T18:54:01Z Indexed on 2010/04/19 19:03 UTC
Read the original article Hit count: 227

insertion_procedure (int a[], int p [], int N)
{
    int i,j,k;
    for (i=0; i<=N; i++) p[i] = i;
    for (i=2; i<=N; i++)
    {
        k = p[i];
        j = 1;
        while (a[p[j-1]] > a[k]) {p[j] = p[j-1]; j--}
        p[j] = k;
    }
}

I have to find cyclometric complexity for this code and then suggest some white box test cases and black box test cases. But I am having trouble making a CFG for the code.

Would appreciate some help on test cases as well.

Thanks a bunch in advance!

© Stack Overflow or respective owner

Related posts about cfg

Related posts about cyclomatic-complexity