Completed
Push — master ( b6f537...796734 )
by Siro Díaz
05:27 queued 02:59
created
DataStructures/Trees/BinarySearchTree.php 1 patch
Doc Comments   +13 added lines, -12 removed lines patch added patch discarded remove patch
@@ -84,8 +84,8 @@  discard block
 block discarded – undo
84 84
     /**
85 85
      * Creates a new node or updates it if already exists.
86 86
      *
87
-     * @param int|string $key the key.
88
-     * @param mixed $data the data to be stored. 
87
+     * @param integer $key the key.
88
+     * @param string $data the data to be stored. 
89 89
      */
90 90
     public function putOrUpdate($key, $data) {
91 91
         $this->put($key, $data, true);
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
     /**
95 95
      * Retrieve the data stored in the tree.
96 96
      *
97
-     * @param int|string $key the key to identify the data.
97
+     * @param integer $key the key to identify the data.
98 98
      * @return mixed
99 99
      */
100 100
     public function get($key) {
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
     /**
133 133
      * Looks for the node with the given key.
134 134
      *
135
-     * @param int|string $key the key used to look for.
135
+     * @param string $key the key used to look for.
136 136
      * @return bool true if was found.
137 137
      */
138 138
     public function exists($key) : bool {
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
     /**
197 197
      * Returns the minimum node from a given node in position X.
198 198
      *
199
-     * @param DataStructures\Trees\Nodes\BSTNode $node the start point.
199
+     * @param Node $node the start point.
200 200
      * @return DataStructures\Trees\Nodes\BSTNode|null the minimum node.
201 201
      */
202 202
     private function getMinNode(Node $node = null) {
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
     /**
238 238
      * Returns the maximum node from a given node in position X.
239 239
      *
240
-     * @param DataStructures\Trees\Nodes\BSTNode $node the start point.
240
+     * @param Node $node the start point.
241 241
      * @return DataStructures\Trees\Nodes\BSTNode|null the maximum node.
242 242
      */
243 243
     private function getMaxNode(Node $node = null) {
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
      * Deletes the node with the minimum key and returns it. The most left and more bottom.
257 257
      * 
258 258
      * @param DataStructures\Trees\Nodes\BSTNode|null if null takes the root.
259
-     * @return DataStructures\Trees\Nodes\BSTNode|null the minimum node or
259
+     * @return Node|null the minimum node or
260 260
      *  null if the tree is empty.
261 261
      */
262 262
     public function deleteMin(Node $node = null) {
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
      * Deletes the node with the maximum key and returns it. The most right and more bottom.
273 273
      * 
274 274
      * @param DataStructures\Trees\Nodes\BSTNode|null if null takes the root.
275
-     * @return DataStructures\Trees\Nodes\BSTNode|null the maximum node or
275
+     * @return Node|null the maximum node or
276 276
      *  null if the tree is empty.
277 277
      */
278 278
     public function deleteMax(Node $node = null) {
@@ -288,7 +288,8 @@  discard block
 block discarded – undo
288 288
      * Deletes the node with the maximum key and returns it. The most right and more bottom.
289 289
      * 
290 290
      * @param DataStructures\Trees\Nodes\BSTNode|null if null takes the root.
291
-     * @return DataStructures\Trees\Nodes\BSTNode|null the maximum node or
291
+     * @param integer $key
292
+     * @return Node|null the maximum node or
292 293
      *  null if the tree is empty.
293 294
      */
294 295
     public function delete($key) {
@@ -331,7 +332,7 @@  discard block
 block discarded – undo
331 332
      * that replaces the deleted node. Also decrease the size of tree.
332 333
      *
333 334
      * @param DataStructures\Trees\Nodes\BSTNode|null The node to be deleted.
334
-     * @return the node that replaces the deleted.
335
+     * @return DataStructures\Trees\Nodes\BSTNode|null node that replaces the deleted.
335 336
      */
336 337
     private function _delete(Node &$node) {
337 338
         if($node !== null) {
@@ -394,7 +395,7 @@  discard block
 block discarded – undo
394 395
      * Returns true if is leaf the node.
395 396
      *
396 397
      * @param DataStructures\Trees\Nodes\BSTNode|null $node default to null.
397
-     * @return true if is leaf the node, is not null and their subtrees has no
398
+     * @return boolean if is leaf the node, is not null and their subtrees has no
398 399
      *  pointers to successors.
399 400
      */
400 401
     public function isLeaf($node) {
@@ -406,7 +407,7 @@  discard block
 block discarded – undo
406 407
      * also are called a root node.
407 408
      *
408 409
      * @param DataStructures\Trees\Nodes\BSTNode|null $node default to null.
409
-     * @return true if is root the node, is not null and their subtrees has no
410
+     * @return boolean if is root the node, is not null and their subtrees has no
410 411
      *  pointers to successors.
411 412
      */
412 413
     public function isRoot($node) {
Please login to merge, or discard this patch.