using System; using System.Collections.Generic; using System.Linq; using System.Text; using C_.Datastructures.Generic; using System.Threading.Tasks; namespace C_.Datastructures.Heap { internal class HeapNode : DirectedNode> { internal int LeftWeight { get; set; } internal int RightWeight { get; set; } //All properties inherited from base class public static HeapNode Create(T value) { //Create a new node without any children return new HeapNode { Value = value }; } public static HeapNode Create(T value, HeapNode? left, HeapNode? right) { //Create a new node with the option of having children return new HeapNode { Value = value, Left = left, LeftWeight = (left != default) ? 1 : 0, Right = right, RightWeight = (right != default) ? 1 : 0 }; } } }