Updated Linked List Node Interface

This commit is contained in:
Luke Else 2022-03-05 19:16:25 +00:00
parent 00f52ee5c7
commit fffce6c6bb
2 changed files with 4 additions and 4 deletions

View File

@ -5,9 +5,9 @@ using System.Threading.Tasks;
namespace C_.Datastructures.Nodes
{
public interface INode<T>
public interface ILinkedListNode<T>
{
public T? Value { get; set; }
public INode<T>? Next { get; set; }
public ILinkedListNode<T>? Next { get; set; }
}
}

View File

@ -6,10 +6,10 @@ using System.Threading.Tasks;
namespace C_.Datastructures.Nodes
{
internal class LinkedListNode<T> : INode<T>
internal class LinkedListNode<T> : ILinkedListNode<T>
{
public T? Value { get; set; } = default;
public INode<T>? Next { get; set; } = default(LinkedListNode<T>);
public ILinkedListNode<T>? Next { get; set; } = default(LinkedListNode<T>);
public static LinkedListNode<T> Create(T? value, LinkedListNode<T>? next)
{