Updated DoublyLinkedListNode to use new Node Type
This commit is contained in:
parent
3d5f1cfbc1
commit
c69c6ee0d3
@ -6,10 +6,8 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace C_.Datastructures.Nodes
|
namespace C_.Datastructures.Nodes
|
||||||
{
|
{
|
||||||
internal class DoublyLinkedListNode<T>
|
internal class DoublyLinkedListNode<T> : Node<T, DoublyLinkedListNode<T>>
|
||||||
{
|
{//Inherits from Node
|
||||||
public T? Value { get; set; } = default;
|
|
||||||
public DoublyLinkedListNode<T>? Next { get; set; } = default;
|
|
||||||
public DoublyLinkedListNode<T>? Prev { get; set; } = default;
|
public DoublyLinkedListNode<T>? Prev { get; set; } = default;
|
||||||
|
|
||||||
public static DoublyLinkedListNode<T> Create(T? value, DoublyLinkedListNode<T>? next, DoublyLinkedListNode<T>? prev)
|
public static DoublyLinkedListNode<T> Create(T? value, DoublyLinkedListNode<T>? next, DoublyLinkedListNode<T>? prev)
|
||||||
|
@ -7,7 +7,7 @@ using System.Threading.Tasks;
|
|||||||
namespace C_.Datastructures.Nodes
|
namespace C_.Datastructures.Nodes
|
||||||
{
|
{
|
||||||
internal class LinkedListNode<T> : Node<T, LinkedListNode<T>>
|
internal class LinkedListNode<T> : Node<T, LinkedListNode<T>>
|
||||||
{
|
{//Inherits from Node
|
||||||
public static LinkedListNode<T> Create(T? value, LinkedListNode<T>? next)
|
public static LinkedListNode<T> Create(T? value, LinkedListNode<T>? next)
|
||||||
{
|
{
|
||||||
return new LinkedListNode<T>
|
return new LinkedListNode<T>
|
||||||
|
@ -7,7 +7,7 @@ using System.Threading.Tasks;
|
|||||||
namespace C_.Datastructures.Nodes
|
namespace C_.Datastructures.Nodes
|
||||||
{
|
{
|
||||||
internal class Node<T, NodeType>
|
internal class Node<T, NodeType>
|
||||||
{
|
{//Generic Node type that every other type inherits from
|
||||||
public T? Value { get; set; } = default;
|
public T? Value { get; set; } = default;
|
||||||
public NodeType? Next { get; set; } = default;
|
public NodeType? Next { get; set; } = default;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user