Updated stack to allow for null references to get added

This commit is contained in:
Luke Else 2022-04-14 20:40:52 +01:00
parent 6906d2e764
commit 9de49129e7

View File

@ -11,7 +11,7 @@ namespace C_.Datastructures.Stack
return new Stack<T>(); return new Stack<T>();
} }
public static Stack<T> Create(T value) public static Stack<T> Create(T? value)
{ {
//Create a new Stack with a head //Create a new Stack with a head
return new Stack<T> return new Stack<T>
@ -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 //Add an Item to the top of the stack
Count++; Count++;