Created Linked List (incomplete)
This commit is contained in:
		
							
								
								
									
										26
									
								
								C#/Datastructures/Nodes/Node.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								C#/Datastructures/Nodes/Node.cs
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,26 @@
 | 
			
		||||
using System;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
 | 
			
		||||
namespace C_.Datastructures.Nodes
 | 
			
		||||
{
 | 
			
		||||
    public interface iNode<T>
 | 
			
		||||
    {
 | 
			
		||||
        public T? Value { get; set; }
 | 
			
		||||
        public iNode<T>? Next { get; set; }
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public class Node<T> : iNode<T>{
 | 
			
		||||
        public T? Value { get; set; } = default(T);
 | 
			
		||||
        public iNode<T>? Next { get; set; } = default(Node<T>);
 | 
			
		||||
 | 
			
		||||
        public static Node<T> Create(T? value, Node<T>? next){
 | 
			
		||||
            return new Node<T>{
 | 
			
		||||
                Value = value,
 | 
			
		||||
                Next = next
 | 
			
		||||
            };
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user