Exemplo n.º 1
0
                return $maxFlipsCount;
            }
            $perm0 = $perm1[0];
            $i = 0;
            while ($i < $r) {
                $j = $i + 1;
                $perm1[$i] = $perm1[$j];
                $i = $j;
            }
            $perm1[$r] = $perm0;
            $count[$r] = $count[$r] - 1;
            if ($count[$r] > 0) {
                break;
            }
            $r++;
        }
    }
}
function fannkuch($n)
{
    Fannkuch_run($n);
}
$all = array();
for ($i = 0; $i < 3; $i++) {
    $start = microtime(true);
    fannkuch(10);
    $all[] = microtime(true) - $start;
}
foreach ($all as $t) {
    echo $t, "\n";
}
Exemplo n.º 2
0
function main_function()
{
    for ($i = 0; $i < 100; ++$i) {
        ackermann(4);
        ary(50000);
        ary2(50000);
        ary3(100);
        fibo(23);
        hash1(10000);
        hash2(200);
        heapsort(2000);
        matrix(3);
        nestedloop(8);
        sieve(5);
        strcat(80000);
        binary_trees(7);
        fannkuch(6);
    }
}
Exemplo n.º 3
0
function main_function()
{
    ackermann(2);
    ary(500);
    ary2(500);
    ary3(5);
    fibo(13);
    hash1(100);
    hash2(20);
    heapsort(200);
    matrix(3);
    nestedloop(3);
    sieve(1);
    strcat(80);
    binary_trees(3);
    fannkuch(6);
}