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