DataStructuresCSharp/C#/Datastructures/Nodes/DoublyLinkedListNode.cs

26 lines
712 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace C_.Datastructures.Nodes
{
internal class DoublyLinkedListNode<T>
{
public T? Value { get; set; } = default;
public DoublyLinkedListNode<T>? Next { get; set; } = default;
public DoublyLinkedListNode<T>? Prev { get; set; } = default;
public static DoublyLinkedListNode<T> Create(T? value, DoublyLinkedListNode<T>? next, DoublyLinkedListNode<T>? prev)
{
return new DoublyLinkedListNode<T>
{
Value = value,
Next = next,
Prev = prev
};
}
}
}