public Insert ( |
||
other | ||
return |
private static LinkedNode BuildList(byte[] primeData) { LinkedNode root; root = new LinkedNode(256, 1); root = root.Insert(new LinkedNode(257, 1)); for (int i = 0; i < primeData.Length; i++) { if (primeData[i] != 0) { root = root.Insert(new LinkedNode(i, primeData[i])); } } return(root); }
private static LinkedNode BuildTree(LinkedNode tail) { LinkedNode current = tail; while (current != null) { LinkedNode child0 = current; LinkedNode child1 = current.Prev; if (child1 == null) { break; } LinkedNode parent = new LinkedNode(0, child0.Weight + child1.Weight); parent.Child0 = child0; child0.Parent = parent; child1.Parent = parent; current.Insert(parent); current = current.Prev.Prev; } return(current); }
private static LinkedNode BuildList(byte[] primeData) { LinkedNode root; root = new LinkedNode(256, 1); root = root.Insert(new LinkedNode(257, 1)); for (int i = 0; i < primeData.Length; i++) { if (primeData[i] != 0) { root = root.Insert(new LinkedNode(i, primeData[i])); } } return root; }