11 instantiations of Node
System.Collections (11)
System\Collections\Generic\SortedSet.cs (11)
308root = new Node(item, NodeColor.Black); 357Node node = new Node(item, NodeColor.Red); 945root = new Node(arr[startIndex], NodeColor.Black); 952root = new Node(arr[startIndex], NodeColor.Black); 953root.Right = new Node(arr[endIndex], NodeColor.Black); 961root = new Node(arr[startIndex + 1], NodeColor.Black); 962root.Left = new Node(arr[startIndex], NodeColor.Black); 963root.Right = new Node(arr[endIndex], NodeColor.Black); 971root = new Node(arr[midpt], NodeColor.Black); 974ConstructRootFromSortedArray(arr, midpt + 2, endIndex, new Node(arr[midpt + 1], NodeColor.Red)) : 1684public Node ShallowClone() => new Node(Item, Color);
107 references to Node
System.Collections (107)
System\Collections\Generic\SortedDictionary.cs (11)
66TreeSet<KeyValuePair<TKey, TValue>>.Node? node = _set.FindNode(keyValuePair); 84TreeSet<KeyValuePair<TKey, TValue>>.Node? node = _set.FindNode(keyValuePair); 112TreeSet<KeyValuePair<TKey, TValue>>.Node? node = _set.FindNode(new KeyValuePair<TKey, TValue>(key, default(TValue)!)); 124TreeSet<KeyValuePair<TKey, TValue>>.Node? node = _set.FindNode(new KeyValuePair<TKey, TValue>(key, default(TValue)!)); 213_set.InOrderTreeWalk(delegate (TreeSet<KeyValuePair<TKey, TValue>>.Node node) 226_set.InOrderTreeWalk(delegate (TreeSet<KeyValuePair<TKey, TValue>>.Node node) 261TreeSet<KeyValuePair<TKey, TValue>>.Node? node = _set.FindNode(new KeyValuePair<TKey, TValue>(key, default(TValue)!)); 545_dictionary._set.InOrderTreeWalk(delegate (TreeSet<KeyValuePair<TKey, TValue>>.Node node) { array[index++] = node.Item.Key; return true; }); 578_dictionary._set.InOrderTreeWalk(delegate (TreeSet<KeyValuePair<TKey, TValue>>.Node node) { objects[index++] = node.Item.Key; return true; }); 706_dictionary._set.InOrderTreeWalk(delegate (TreeSet<KeyValuePair<TKey, TValue>>.Node node) { array[index++] = node.Item.Value; return true; }); 739_dictionary._set.InOrderTreeWalk(delegate (TreeSet<KeyValuePair<TKey, TValue>>.Node node) { objects[index++] = node.Item.Value; return true; });
System\Collections\Generic\SortedSet.cs (86)
35internal delegate bool TreeWalkPredicate<T>(SortedSet<T>.Node node); 53private Node? root; 194var stack = new Stack<Node>(2 * (int)Log2(Count + 1)); 195Node? current = root; 211Node? node = current.Right; 237var processQueue = new Queue<Node>(); 240Node current; 317Node? current = root; 318Node? parent = null; 319Node? grandParent = null; 320Node? greatGrandParent = null; 343if (Node.IsNonNullRed(parent)) 357Node node = new Node(item, NodeColor.Red); 400Node? current = root; 401Node? parent = null; 402Node? grandParent = null; 403Node? match = null; 404Node? parentOfMatch = null; 418Node sibling = parent.GetSibling(current); 448Debug.Assert(Node.IsNonNullBlack(sibling)); 458Node newGrandParent = parent.Rotate(parent.GetRotation(current, sibling))!; 607private void InsertionBalance(Node current, ref Node parent, Node grandParent, Node greatGrandParent) 615Node newChildOfGreatGrandParent; 642private void ReplaceChildOrRoot(Node? parent, Node child, Node newChild) 657private void ReplaceNode(Node match, Node parentOfMatch, Node successor, Node parentOfSuccessor) 690internal virtual Node? FindNode(T item) 692Node? current = root; 723Node? current = root; 740internal Node? FindRange(T? from, T? to) => FindRange(from, to, lowerBoundActive: true, upperBoundActive: true); 742internal Node? FindRange(T? from, T? to, bool lowerBoundActive, bool upperBoundActive) 744Node? current = root; 917private static Node? ConstructRootFromSortedArray(T[] arr, int startIndex, int endIndex, Node? redNode) 938Node root; 1468Node current = root; 1489Node current = root; 1599public static bool IsNonNullBlack(Node? node) => node != null && node.IsBlack; 1601public static bool IsNonNullRed(Node? node) => node != null && node.IsRed; 1603public static bool IsNullOrBlack(Node? node) => node == null || node.IsBlack; 1607public Node? Left { get; set; } 1609public Node? Right { get; set; } 1625public Node DeepClone(int count) 1630Node newRoot = ShallowClone(); 1632var pendingNodes = new Stack<(Node source, Node target)>(2 * Log2(count) + 2); 1637Node clonedNode; 1639if (next.source.Left is Node left) 1646if (next.source.Right is Node right) 1660public TreeRotation GetRotation(Node current, Node sibling) 1676public Node GetSibling(Node node) 1684public Node ShallowClone() => new Node(Item, Color); 1699public Node? Rotate(TreeRotation rotation) 1701Node removeRed; 1729public Node RotateLeft() 1731Node child = Right!; 1740public Node RotateLeftRight() 1742Node child = Left!; 1743Node grandChild = child.Right!; 1755public Node RotateRight() 1757Node child = Left!; 1766public Node RotateRightLeft() 1768Node child = Right!; 1769Node grandChild = child.Left!; 1798public void ReplaceChild(Node child, Node newChild) 1817private bool HasChild(Node child) => child == Left || child == Right; 1819private bool HasChildren(Node child1, Node child2) 1834private readonly Stack<Node> _stack; 1835private Node? _current; 1851_stack = new Stack<Node>(2 * (int)Log2(set.TotalCount() + 1)); 1871Node? node = _tree.root; 1872Node? next, other; 1910Node? node = (_reverse ? _current.Left : _current.Right); 1911Node? next, other; 2000Node? node = FindNode(equalValue);
System\Collections\Generic\SortedSet.TreeSubSet.cs (10)
129Node? current = root; 160Node? current = root; 196Stack<Node> stack = new Stack<Node>(2 * (int)SortedSet<T>.Log2(count + 1)); // this is not exactly right if count is out of date, but the stack can grow 197Node? current = root; 223Node? node = current.Right; 253Queue<Node> processQueue = new Queue<Node>(); 255Node current; 276internal override SortedSet<T>.Node? FindNode(T item)