Updated Heap to allow Heap Creation (Not fully implemented)
This commit is contained in:
		@@ -23,5 +23,22 @@ namespace C_.Datastructures.Heap
 | 
			
		||||
                Count = 1
 | 
			
		||||
            };
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public void Add(T value){
 | 
			
		||||
            Count++;
 | 
			
		||||
 | 
			
		||||
            if (Root == default)
 | 
			
		||||
            {//If the new node needs to be added to the top of the heap
 | 
			
		||||
                Root = HeapNode<T>.Create(value);
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            //If the new node can be placed in a subchild
 | 
			
		||||
            HeapNode<T> node = Root;
 | 
			
		||||
 | 
			
		||||
            while(node.Left != default){
 | 
			
		||||
                node = node.Left;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user