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

26 lines
600 B
C#
Raw Normal View History

2022-03-03 10:12:42 +00:00
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
};
}
}
}