Example #1
0
{
    $minDepth = 4;
    $maxDepth = max($minDepth + 2, $n);
    $stretchDepth = $maxDepth + 1;
    $stretchTree = bottomUpTree(0, $stretchDepth);
    unset($stretchTree);
    $longLivedTree = bottomUpTree(0, $maxDepth);
    $iterations = 1 << $maxDepth;
    do {
        $check = 0;
        for ($i = 1; $i <= $iterations; ++$i) {
            $t = bottomUpTree($i, $minDepth);
            $check += itemCheck($t);
            unset($t);
            $t = bottomUpTree(-$i, $minDepth);
            $check += itemCheck($t);
            unset($t);
        }
        $minDepth += 2;
        $iterations >>= 2;
    } while ($minDepth <= $maxDepth);
}
$all = array();
for ($i = 0; $i < 10; $i++) {
    $start = microtime(true);
    binary_trees(13);
    $all[] = microtime(true) - $start;
}
foreach ($all as $t) {
    echo $t, "\n";
}
Example #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);
    }
}
Example #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);
}