Files

44 lines
763 B
PHP

<?php
namespace DataStructures\ReverseLinkedList;
class LinkedListItem
{
private ?LinkedListItem $next = null;
private ?LinkedListItem $prev = null;
private $value;
public function setNext(?LinkedListItem $next)
{
$this->next = $next;
return $this;
}
public function getNext(): ?LinkedListItem
{
return $this->next;
}
public function setPrev(?LinkedListItem $prev)
{
$this->prev = $prev;
return $this;
}
public function getPrev(): ?LinkedListItem
{
return $this->prev;
}
public function setValue($value)
{
$this->value = $value;
return $this;
}
public function getValue()
{
return $this->value;
}
}