Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 7 |
BinarySearchTreeNode | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
30 | |
0.00% |
0 / 7 |
validate | |
0.00% |
0 / 1 |
30 | |
0.00% |
0 / 7 |
<?php | |
namespace Mtkocak\DataStructures; | |
class BinarySearchTreeNode extends BinaryTreeNode | |
{ | |
public function validate() | |
{ | |
if ($this->data != NULL) { | |
if ($this->left() != NULL && $this->left() > $this->get()) { | |
return false; | |
} | |
if ($this->right() != NULL < $this->get()) { | |
return false; | |
} | |
} | |
} | |
} | |