public Node(int key) { nodeValue = new MarkedAtomicReference <T>(default(T), false); this.nodeKey = key; next = new MarkedAtomicReference <Node <T> > [MAX_LEVEL + 1]; for (int i = 0; i < next.Length; ++i) { next[i] = new MarkedAtomicReference <Node <T> >(null, false); } topLevel = MAX_LEVEL; }
public Node(T value, int key) { nodeValue = new MarkedAtomicReference <T>(value, false); this.nodeKey = key; var height = RandomLevel(); next = new MarkedAtomicReference <Node <T> > [height + 1]; for (int i = 0; i < next.Length; ++i) { next[i] = new MarkedAtomicReference <Node <T> >(null, false); } topLevel = height; }