Completed
Push — master ( b592b0...7a2d4e )
by Siro Díaz
02:02
created
DataStructures/Trees/BinarySearchTree.php 1 patch
Doc Comments   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -74,8 +74,8 @@  discard block
 block discarded – undo
74 74
     /**
75 75
      * Creates a new node or updates it if already exists.
76 76
      *
77
-     * @param int|string $key the key.
78
-     * @param mixed $data the data to be stored. 
77
+     * @param integer $key the key.
78
+     * @param string $data the data to be stored. 
79 79
      */
80 80
     public function putOrUpdate($key, $data) {
81 81
         $this->put($key, $data, true);
@@ -85,7 +85,8 @@  discard block
 block discarded – undo
85 85
      * Deletes the node with the maximum key and returns it. The most right and more bottom.
86 86
      * 
87 87
      * @param DataStructures\Trees\Nodes\BSTNode|null if null takes the root.
88
-     * @return DataStructures\Trees\Nodes\BSTNode|null the maximum node or
88
+     * @param integer $key
89
+     * @return BinaryNodeInterface|null the maximum node or
89 90
      *  null if the tree is empty.
90 91
      */
91 92
     public function delete($key) {
@@ -103,7 +104,7 @@  discard block
 block discarded – undo
103 104
      * that replaces the deleted node. Also decrease the size of tree.
104 105
      *
105 106
      * @param DataStructures\Trees\Nodes\BSTNode|null The node to be deleted.
106
-     * @return the node that replaces the deleted.
107
+     * @return DataStructures\Trees\Nodes\BSTNode|null node that replaces the deleted.
107 108
      */
108 109
     protected function _delete(BinaryNodeInterface &$node) {
109 110
         if($node !== null) {
Please login to merge, or discard this patch.
DataStructures/Trees/BinaryTreeAbstract.php 1 patch
Doc Comments   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     /**
34 34
      * Retrieve the data stored in the tree.
35 35
      *
36
-     * @param int|string $key the key to identify the data.
36
+     * @param integer $key the key to identify the data.
37 37
      * @return mixed
38 38
      */
39 39
     public function get($key){
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     /**
68 68
      * Looks for the node with the given key.
69 69
      *
70
-     * @param int|string $key the key used to look for.
70
+     * @param string $key the key used to look for.
71 71
      * @return bool true if was found.
72 72
      */
73 73
     public function exists($key){
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
     /**
170 170
      * Returns the minimum node from a given node in position X.
171 171
      *
172
-     * @param DataStructures\Trees\Nodes\BSTNode $node the start point.
172
+     * @param BinaryNodeInterface $node the start point.
173 173
      * @return DataStructures\Trees\Nodes\BSTNode|null the minimum node.
174 174
      */
175 175
     private function getMinNode(BinaryNodeInterface $node = null) {
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
     /**
188 188
      * Returns the maximum node from a given node in position X.
189 189
      *
190
-     * @param DataStructures\Trees\Nodes\BSTNode $node the start point.
190
+     * @param BinaryNodeInterface $node the start point.
191 191
      * @return DataStructures\Trees\Nodes\BSTNode|null the maximum node.
192 192
      */
193 193
     private function getMaxNode(BinaryNodeInterface $node = null) {
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
      * Deletes the node with the minimum key and returns it. The most left and more bottom.
207 207
      * 
208 208
      * @param DataStructures\Trees\Nodes\BSTNode|null if null takes the root.
209
-     * @return DataStructures\Trees\Nodes\BSTNode|null the minimum node or
209
+     * @return BinaryNodeInterface|null the minimum node or
210 210
      *  null if the tree is empty.
211 211
      */
212 212
     public function deleteMin(BinaryNodeInterface $node = null) {
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
      * Deletes the node with the maximum key and returns it. The most right and more bottom.
223 223
      * 
224 224
      * @param DataStructures\Trees\Nodes\BSTNode|null if null takes the root.
225
-     * @return DataStructures\Trees\Nodes\BSTNode|null the maximum node or
225
+     * @return BinaryNodeInterface|null the maximum node or
226 226
      *  null if the tree is empty.
227 227
      */
228 228
     public function deleteMax(BinaryNodeInterface $node = null) {
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
      * Returns true if is leaf the node.
304 304
      *
305 305
      * @param DataStructures\Trees\Nodes\BSTNode|null $node default to null.
306
-     * @return true if is leaf the node, is not null and their subtrees has no
306
+     * @return boolean if is leaf the node, is not null and their subtrees has no
307 307
      *  pointers to successors.
308 308
      */
309 309
     public function isLeaf($node) { // BinaryTreeNode
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
      * also are called a root node.
316 316
      *
317 317
      * @param DataStructures\Trees\Nodes\BSTNode|null $node default to null.
318
-     * @return true if is root the node, is not null and their subtrees has no
318
+     * @return boolean if is root the node, is not null and their subtrees has no
319 319
      *  pointers to successors.
320 320
      */
321 321
     public function isRoot($node) {
Please login to merge, or discard this patch.