Fixed CS0019 Error - Cannot assume type T is a reference type but instead can infer that a default node can mean that the tree is empty
This commit is contained in:
		@@ -44,17 +44,16 @@ namespace C_.Datastructures.BinarySearchTree
 | 
			
		||||
            //Insert to right
 | 
			
		||||
            node.Right = TreeNode<T>.Create(value);
 | 
			
		||||
            return;
 | 
			
		||||
 | 
			
		||||
            
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public bool Find(T? value){
 | 
			
		||||
            if (Root.Value != default || Root.Value == value)
 | 
			
		||||
            if (Root == default)
 | 
			
		||||
            {
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        private TreeNode<T>? Descend(T value, TreeNode<T>? current)
 | 
			
		||||
        {//Keep trying to determine whether to go left or right until null node is found that can be appended to
 | 
			
		||||
            if (current == default)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user