This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class BinarySearchTree { | |
private $_root; | |
public function __construct() { | |
// setup sentinal node | |
$this->_root = new BinarySearchNode(null); | |
} | |
public function getRoot() { | |
return $this->hasNode() ? $this->_root->right : null; |