private HeapNode MergeNodes(HeapNode l, HeapNode r) { if (l == null) { return(r); } if (r == null) { return(l); } if (l.Value.CompareTo(r.Value) > 0) { r.AddFirstChild(l); return(r); } else { l.AddLastChild(r); return(l); } }
private HeapNode MergeNodes(HeapNode l, HeapNode r) { if (l == null) { return(r); } if (r == null) { return(l); } if (l.Value.CompareTo(r.Value) > 0) { r.AddFirstChild(l); return(r); } else { l.AddLastChild(r); return(l); } }