Stack Completed
This commit is contained in:
		@@ -21,7 +21,7 @@ namespace C_.Datastructures
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public void Push(T value){
 | 
			
		||||
            //Add an Item to the end of the list
 | 
			
		||||
            //Add an Item to the top of the stacks
 | 
			
		||||
            if (Count > 0)
 | 
			
		||||
            {    
 | 
			
		||||
                Count++;
 | 
			
		||||
@@ -31,6 +31,7 @@ namespace C_.Datastructures
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public T? Pop(){
 | 
			
		||||
            //Take the item off of the top of the stack
 | 
			
		||||
            T? value = default;
 | 
			
		||||
            if (Count > 0)
 | 
			
		||||
            {//Assign the default value if there are any items left in the stack
 | 
			
		||||
@@ -42,6 +43,7 @@ namespace C_.Datastructures
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public T? Peek(){
 | 
			
		||||
            //View item on top of the stack
 | 
			
		||||
            if (Count > 0)
 | 
			
		||||
            {
 | 
			
		||||
                return Head!.Value;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user