From 6e63055274d93a73468bbb9fd4e3e7b6a9229b4b Mon Sep 17 00:00:00 2001 From: Luke Else Date: Sat, 26 Mar 2022 22:31:47 +0000 Subject: [PATCH] StackNode Created - Provisional setup --- .../Nodes/DoublyLinkedListNode.cs | 1 - C#/Datastructures/Nodes/StackNode.cs | 22 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 C#/Datastructures/Nodes/StackNode.cs diff --git a/C#/Datastructures/Nodes/DoublyLinkedListNode.cs b/C#/Datastructures/Nodes/DoublyLinkedListNode.cs index e96befd..9d262ff 100644 --- a/C#/Datastructures/Nodes/DoublyLinkedListNode.cs +++ b/C#/Datastructures/Nodes/DoublyLinkedListNode.cs @@ -10,7 +10,6 @@ namespace C_.Datastructures.Nodes { public T? Value { get; set; } = default; public DoublyLinkedListNode? Next { get; set; } = default; - public DoublyLinkedListNode? Prev { get; set; } = default; public static DoublyLinkedListNode Create(T? value, DoublyLinkedListNode? next, DoublyLinkedListNode? prev) diff --git a/C#/Datastructures/Nodes/StackNode.cs b/C#/Datastructures/Nodes/StackNode.cs new file mode 100644 index 0000000..4735bf9 --- /dev/null +++ b/C#/Datastructures/Nodes/StackNode.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace C_.Datastructures.Nodes +{ + internal class StackNode + { + public T? Value { get; set; } = default; + public StackNode? Next { get; set; } = default; + + public static StackNode Create(T? value, StackNode? next) + { + return new StackNode + { + Value = value, + Next = next + }; + } + } +} \ No newline at end of file