404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.16.50.94: ~ $
--TEST--
link_007: Test many corner cases
--FILE--
<?php
 
$dir = dirname(__FILE__);
require 'Structures/LinkedList/Double.php';
require 'LinkTester.php';

$xyy = new Structures_LinkedList_Double();

// prepend to an empty list corner case: 1
$xyy->prependNode($tester1);
print "Current: {$xyy->current()->getNumb()}\n";

// prepend to a list with only one element: 21
$xyy->prependNode($tester2);
print "Current: {$xyy->current()->getNumb()}\n";

// insert after tail node corner case: 213
$xyy->insertNode($tester3, $tester1);
print "Current: {$xyy->current()->getNumb()}\n";

// insert before root node corner case: 4213
$xyy->insertNode($tester4, $tester2, true);
print "Current: {$xyy->current()->getNumb()}\n";

// insert before tail node corner case: 42153
$xyy->insertNode($tester5, $tester3, true);
print "Current: {$xyy->current()->getNumb()}\n";

// insert after root node corner case: 421653
$xyy->insertNode($tester6, $tester1);
print "Current: {$xyy->current()->getNumb()}\n";

print "Foreach: ";
foreach ($xyy as $node) {
    print $node->getNumb();
}

print "\nWhile (in reverse): ";
// test reverse iteration with while()
$link = $xyy->end();
do {
    print $link->getNumb();
} while ($link = $xyy->previous());
?>
--EXPECT--
Current: 1
Current: 1
Current: 1
Current: 1
Current: 1
Current: 1
Foreach: 421653
While (in reverse): 356124

Filemanager

Name Type Size Permission Actions
LinkTester.php File 492 B 0644
SingleLinkTester.php File 462 B 0644
link_001.phpt File 987 B 0644
link_002.phpt File 675 B 0644
link_003.phpt File 1000 B 0644
link_004.phpt File 544 B 0644
link_005.phpt File 1.21 KB 0644
link_006.phpt File 991 B 0644
link_007.phpt File 1.32 KB 0644
single_link_001.phpt File 1000 B 0644
single_link_002.phpt File 688 B 0644
single_link_003.phpt File 1013 B 0644
single_link_004.phpt File 557 B 0644
single_link_005.phpt File 1.22 KB 0644
single_link_006.phpt File 1004 B 0644
single_link_007.phpt File 1.19 KB 0644