Simplified Push Method
This commit is contained in:
parent
c54401fdbb
commit
703826c8a6
@ -23,12 +23,7 @@ namespace C_.Datastructures
|
|||||||
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++;
|
||||||
if (Count > 0)
|
Head = StackNode<T>.Create(value, Head);
|
||||||
{
|
|
||||||
Head = StackNode<T>.Create(value, Head);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Head = StackNode<T>.Create(value, default);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user