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); 948root = new Node(arr[startIndex], NodeColor.Black); 955root = new Node(arr[startIndex], NodeColor.Black); 956root.Right = new Node(arr[endIndex], NodeColor.Black); 964root = new Node(arr[startIndex + 1], NodeColor.Black); 965root.Left = new Node(arr[startIndex], NodeColor.Black); 966root.Right = new Node(arr[endIndex], NodeColor.Black); 974root = new Node(arr[midpt], NodeColor.Black); 977ConstructRootFromSortedArray(arr, midpt + 2, endIndex, new Node(arr[midpt + 1], NodeColor.Red)) : 1687public 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); 115TreeSet<KeyValuePair<TKey, TValue>>.Node? node = _set.FindNode(new KeyValuePair<TKey, TValue>(key, default(TValue)!)); 130TreeSet<KeyValuePair<TKey, TValue>>.Node? node = _set.FindNode(new KeyValuePair<TKey, TValue>(key, default(TValue)!)); 219_set.InOrderTreeWalk(delegate (TreeSet<KeyValuePair<TKey, TValue>>.Node node) 232_set.InOrderTreeWalk(delegate (TreeSet<KeyValuePair<TKey, TValue>>.Node node) 267TreeSet<KeyValuePair<TKey, TValue>>.Node? node = _set.FindNode(new KeyValuePair<TKey, TValue>(key, default(TValue)!)); 553_dictionary._set.InOrderTreeWalk(delegate (TreeSet<KeyValuePair<TKey, TValue>>.Node node) { array[index++] = node.Item.Key; return true; }); 586_dictionary._set.InOrderTreeWalk(delegate (TreeSet<KeyValuePair<TKey, TValue>>.Node node) { objects[index++] = node.Item.Key; return true; }); 714_dictionary._set.InOrderTreeWalk(delegate (TreeSet<KeyValuePair<TKey, TValue>>.Node node) { array[index++] = node.Item.Value; return true; }); 747_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) 693internal virtual Node? FindNode(T item) 695Node? current = root; 726Node? current = root; 743internal Node? FindRange(T? from, T? to) => FindRange(from, to, lowerBoundActive: true, upperBoundActive: true); 745internal Node? FindRange(T? from, T? to, bool lowerBoundActive, bool upperBoundActive) 747Node? current = root; 920private static Node? ConstructRootFromSortedArray(T[] arr, int startIndex, int endIndex, Node? redNode) 941Node root; 1471Node current = root; 1492Node current = root; 1602public static bool IsNonNullBlack(Node? node) => node != null && node.IsBlack; 1604public static bool IsNonNullRed(Node? node) => node != null && node.IsRed; 1606public static bool IsNullOrBlack(Node? node) => node == null || node.IsBlack; 1610public Node? Left { get; set; } 1612public Node? Right { get; set; } 1628public Node DeepClone(int count) 1633Node newRoot = ShallowClone(); 1635var pendingNodes = new Stack<(Node source, Node target)>(2 * Log2(count) + 2); 1640Node clonedNode; 1642if (next.source.Left is Node left) 1649if (next.source.Right is Node right) 1663public TreeRotation GetRotation(Node current, Node sibling) 1679public Node GetSibling(Node node) 1687public Node ShallowClone() => new Node(Item, Color); 1702public Node? Rotate(TreeRotation rotation) 1704Node removeRed; 1732public Node RotateLeft() 1734Node child = Right!; 1743public Node RotateLeftRight() 1745Node child = Left!; 1746Node grandChild = child.Right!; 1758public Node RotateRight() 1760Node child = Left!; 1769public Node RotateRightLeft() 1771Node child = Right!; 1772Node grandChild = child.Left!; 1801public void ReplaceChild(Node child, Node newChild) 1820private bool HasChild(Node child) => child == Left || child == Right; 1822private bool HasChildren(Node child1, Node child2) 1837private readonly Stack<Node> _stack; 1838private Node? _current; 1854_stack = new Stack<Node>(2 * (int)Log2(set.TotalCount() + 1)); 1874Node? node = _tree.root; 1875Node? next, other; 1913Node? node = (_reverse ? _current.Left : _current.Right); 1914Node? next, other; 2003Node? 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)