@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | /** |
| 239 | 239 | * Returns the minimum node from a given node in position X. |
| 240 | 240 | * |
| 241 | - * @param DataStructures\Trees\Nodes\BinaryNodeInterface $node the start point. |
|
| 241 | + * @param BinaryNodeInterface $node the start point. |
|
| 242 | 242 | * @return DataStructures\Trees\Nodes\BinaryNodeInterface|null the minimum node. |
| 243 | 243 | */ |
| 244 | 244 | protected function getMinNode(BinaryNodeInterface $node = null) { |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | /** |
| 257 | 257 | * Returns the maximum node from a given node in position X. |
| 258 | 258 | * |
| 259 | - * @param DataStructures\Trees\Nodes\BinaryNodeInterface $node the start point. |
|
| 259 | + * @param BinaryNodeInterface $node the start point. |
|
| 260 | 260 | * @return DataStructures\Trees\Nodes\BinaryNodeInterface|null the maximum node. |
| 261 | 261 | */ |
| 262 | 262 | protected function getMaxNode(BinaryNodeInterface $node = null) { |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | * Deletes the node with the minimum key and returns it. The most left and more bottom. |
| 276 | 276 | * |
| 277 | 277 | * @param DataStructures\Trees\Nodes\BinaryNodeInterface|null if null takes the root. |
| 278 | - * @return DataStructures\Trees\Nodes\BinaryNodeInterface|null the minimum node or |
|
| 278 | + * @return BinaryNodeInterface|null the minimum node or |
|
| 279 | 279 | * null if the tree is empty. |
| 280 | 280 | */ |
| 281 | 281 | public function deleteMin(BinaryNodeInterface $node = null) { |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | * Deletes the node with the maximum key and returns it. The most right and more bottom. |
| 292 | 292 | * |
| 293 | 293 | * @param DataStructures\Trees\Nodes\BinaryNodeInterface|null if null takes the root. |
| 294 | - * @return DataStructures\Trees\Nodes\BinaryNodeInterface|null the maximum node or |
|
| 294 | + * @return BinaryNodeInterface|null the maximum node or |
|
| 295 | 295 | * null if the tree is empty. |
| 296 | 296 | */ |
| 297 | 297 | public function deleteMax(BinaryNodeInterface $node = null) { |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | * Deletes the node with the maximum key and returns it. The most right and more bottom. |
| 308 | 308 | * |
| 309 | 309 | * @param DataStructures\Trees\Nodes\BinaryNodeInterface|null if null takes the root. |
| 310 | - * @return DataStructures\Trees\Nodes\BinaryNodeInterface|null the maximum node or |
|
| 310 | + * @return BinaryNodeInterface|null the maximum node or |
|
| 311 | 311 | * null if the tree is empty. |
| 312 | 312 | */ |
| 313 | 313 | public function delete($key) { |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | * that replaces the deleted node. Also decrease the size of tree. |
| 326 | 326 | * |
| 327 | 327 | * @param DataStructures\Trees\Nodes\BinaryNodeInterface|null The node to be deleted. |
| 328 | - * @return the node that replaces the deleted. |
|
| 328 | + * @return DataStructures\Trees\Nodes\BinaryNodeInterface|null node that replaces the deleted. |
|
| 329 | 329 | */ |
| 330 | 330 | protected function _delete(BinaryNodeInterface &$node) { |
| 331 | 331 | if($node !== null) { |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | * Returns true if is leaf the node. |
| 414 | 414 | * |
| 415 | 415 | * @param DataStructures\Trees\Nodes\BinaryNodeInterface|null $node default to null. |
| 416 | - * @return true if is leaf the node, is not null and their subtrees has no |
|
| 416 | + * @return boolean if is leaf the node, is not null and their subtrees has no |
|
| 417 | 417 | * pointers to successors. |
| 418 | 418 | */ |
| 419 | 419 | public function isLeaf($node) : bool { // BinaryTreeNode |
@@ -425,7 +425,7 @@ discard block |
||
| 425 | 425 | * also are called a root node. |
| 426 | 426 | * |
| 427 | 427 | * @param DataStructures\Trees\Nodes\BinaryNodeInterface|null $node default to null. |
| 428 | - * @return true if is root the node, is not null and their subtrees has no |
|
| 428 | + * @return boolean if is root the node, is not null and their subtrees has no |
|
| 429 | 429 | * pointers to successors. |
| 430 | 430 | */ |
| 431 | 431 | public function isRoot($node) : bool { |
@@ -450,6 +450,7 @@ discard block |
||
| 450 | 450 | * @param DataStructures\Trees\Nodes\BinaryNodeInterface|null $node. |
| 451 | 451 | * @param Callable|null $callback the callback function to apply to each |
| 452 | 452 | * node. |
| 453 | + * @param null|DataStructures\Trees\Nodes\BinaryNodeInterface $node |
|
| 453 | 454 | */ |
| 454 | 455 | private function _preorder($node, Callable $callback = null) { |
| 455 | 456 | if($node === null) { |
@@ -480,6 +481,7 @@ discard block |
||
| 480 | 481 | * @param DataStructures\Trees\Nodes\BinaryNodeInterface|null $node. |
| 481 | 482 | * @param Callable|null $callback the callback function to apply to each |
| 482 | 483 | * node. |
| 484 | + * @param null|DataStructures\Trees\Nodes\BinaryNodeInterface $node |
|
| 483 | 485 | */ |
| 484 | 486 | private function _inorder($node, Callable $callback = null) { |
| 485 | 487 | if($node === null) { |
@@ -511,6 +513,7 @@ discard block |
||
| 511 | 513 | * @param DataStructures\Trees\Nodes\BinaryNodeInterface|null $node. |
| 512 | 514 | * @param Callable|null $callback the callback function to apply to each |
| 513 | 515 | * node. |
| 516 | + * @param null|DataStructures\Trees\Nodes\BinaryNodeInterface $node |
|
| 514 | 517 | */ |
| 515 | 518 | private function _postorder($node, Callable $callback = null) { |
| 516 | 519 | if($node === null) { |