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