Exemplo n.º 1
0
 /**
  * @return mixed
  * @throws EmptyException when the tree is empty
  */
 function first()
 {
     return $this->avl->first();
 }
Exemplo n.º 2
0
 function testFindFirst()
 {
     $tree = new SplayTree();
     $tree->add(0);
     $tree->add(2);
     $tree->add(1);
     $expected = 0;
     $actual = $tree->first();
     $this->assertEquals($expected, $actual);
 }