26 lines
600 B
C#
26 lines
600 B
C#
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using System.Linq;
|
||
|
using System.Threading.Tasks;
|
||
|
|
||
|
namespace C_.Datastructures.Nodes
|
||
|
{
|
||
|
public interface iNode<T>
|
||
|
{
|
||
|
public T? Value { get; set; }
|
||
|
public iNode<T>? Next { get; set; }
|
||
|
|
||
|
}
|
||
|
|
||
|
public class Node<T> : iNode<T>{
|
||
|
public T? Value { get; set; } = default(T);
|
||
|
public iNode<T>? Next { get; set; } = default(Node<T>);
|
||
|
|
||
|
public static Node<T> Create(T? value, Node<T>? next){
|
||
|
return new Node<T>{
|
||
|
Value = value,
|
||
|
Next = next
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
}
|