Skip to content

Instantly share code, notes, and snippets.

View Guley's full-sized avatar
🎯
Focusing

Gulshan Guley

🎯
Focusing
View GitHub Profile
@Guley
Guley / binary_search_tree.php
Created July 8, 2021 05:10 — forked from meetrajesh/binary_search_tree.php
An efficient binary search tree (BST) implementation in PHP.
<?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;