2022-03-04 16:58:31 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
2022-03-06 09:10:17 +00:00
|
|
|
|
namespace C_.Datastructures.Nodes.LinkedList
|
2022-03-04 16:58:31 +00:00
|
|
|
|
{
|
2022-03-06 09:10:17 +00:00
|
|
|
|
internal class LinkedListNode<T> : INode<T>
|
2022-03-04 16:58:31 +00:00
|
|
|
|
{
|
|
|
|
|
public T? Value { get; set; } = default;
|
2022-03-06 09:10:17 +00:00
|
|
|
|
public INode<T>? Next { get; set; } = default(LinkedListNode<T>);
|
2022-03-04 16:58:31 +00:00
|
|
|
|
|
|
|
|
|
public static LinkedListNode<T> Create(T? value, LinkedListNode<T>? next)
|
|
|
|
|
{
|
|
|
|
|
return new LinkedListNode<T>
|
|
|
|
|
{
|
|
|
|
|
Value = value,
|
|
|
|
|
Next = next
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|