From 9de49129e7a3d53f3894a33b2d1d0cc13e6cc2b2 Mon Sep 17 00:00:00 2001 From: Luke Else Date: Thu, 14 Apr 2022 20:40:52 +0100 Subject: [PATCH] Updated stack to allow for null references to get added --- C#/Datastructures/Stack/Stack.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C#/Datastructures/Stack/Stack.cs b/C#/Datastructures/Stack/Stack.cs index 3901776..8d845fe 100644 --- a/C#/Datastructures/Stack/Stack.cs +++ b/C#/Datastructures/Stack/Stack.cs @@ -11,7 +11,7 @@ namespace C_.Datastructures.Stack return new Stack(); } - public static Stack Create(T value) + public static Stack Create(T? value) { //Create a new Stack with a head return new Stack @@ -21,7 +21,7 @@ namespace C_.Datastructures.Stack }; } - public void Push(T value) + public void Push(T? value) { //Add an Item to the top of the stack Count++;