DataStructures/Lists/CircularLinkedList.php 1 location
|
@@ 373-380 (lines=8) @@
|
370 |
|
* |
371 |
|
* @return mixed the data stored in the node. |
372 |
|
*/ |
373 |
|
private function deleteBeginning() { |
374 |
|
$temp = $this->head; |
375 |
|
$this->head = &$this->head->next; |
376 |
|
$this->tail->next = &$this->head; |
377 |
|
$this->size--; |
378 |
|
|
379 |
|
return $temp->data; |
380 |
|
} |
381 |
|
|
382 |
|
/** |
383 |
|
* Deletes at the specified position and returns the data stored. |
DataStructures/Lists/DoublyLinkedList.php 1 location
|
@@ 391-398 (lines=8) @@
|
388 |
|
* |
389 |
|
* @return mixed the data stored in the node. |
390 |
|
*/ |
391 |
|
private function deleteBeginning() { |
392 |
|
$temp = $this->head; |
393 |
|
$this->head = &$this->head->next; |
394 |
|
$this->tail->next = &$this->head; |
395 |
|
$this->size--; |
396 |
|
|
397 |
|
return $temp->data; |
398 |
|
} |
399 |
|
|
400 |
|
/** |
401 |
|
* Deletes at the specified position and returns the data stored. |