Simplified Push Method

This commit is contained in:
Luke Else 2022-03-31 22:05:13 +01:00
parent c54401fdbb
commit 703826c8a6

View File

@ -23,14 +23,9 @@ namespace C_.Datastructures
public void Push(T value){
//Add an Item to the top of the stack
Count++;
if (Count > 0)
{
Head = StackNode<T>.Create(value, Head);
return;
}
Head = StackNode<T>.Create(value, default);
return;
}
public T? Pop(){
//Take the item off of the top of the stack