DataStructures/Lists/CircularLinkedList.php 1 location
|
@@ 165-172 (lines=8) @@
|
162 |
|
* @throws OutOfBoundsException if it is out of limits (< 0 or > size - 1) |
163 |
|
* @return mixed the data stored in $index node. |
164 |
|
*/ |
165 |
|
public function get($index) { |
166 |
|
$node = $this->search($index); |
167 |
|
if($node === null) { |
168 |
|
return null; |
169 |
|
} |
170 |
|
|
171 |
|
return $node->data; |
172 |
|
} |
173 |
|
|
174 |
|
/** |
175 |
|
* Returns the node stored in the given position. |
DataStructures/Lists/DoublyLinkedList.php 1 location
|
@@ 57-64 (lines=8) @@
|
54 |
|
* @return mixed The data stored in the given index |
55 |
|
* @throws OutOfBoundsException if index is out bounds. |
56 |
|
*/ |
57 |
|
public function get($index) { |
58 |
|
$node = $this->search($index); |
59 |
|
if($node === null) { |
60 |
|
return null; |
61 |
|
} |
62 |
|
|
63 |
|
return $node->data; |
64 |
|
} |
65 |
|
|
66 |
|
/** |
67 |
|
* Gets the node stored in the position especified. |
DataStructures/Lists/SimpleLinkedList.php 1 location
|
@@ 68-75 (lines=8) @@
|
65 |
|
* @return mixed The data stored in the given index |
66 |
|
* @throws OutOfBoundsException if index is out bounds. |
67 |
|
*/ |
68 |
|
public function get($index) { |
69 |
|
$node = $this->search($index); |
70 |
|
if($node === null) { |
71 |
|
return null; |
72 |
|
} |
73 |
|
|
74 |
|
return $node->data; |
75 |
|
} |
76 |
|
|
77 |
|
/** |
78 |
|
* Returns the node stored in the given position. |