Beispiel #1
0
 /// <summary>
 /// Removes all items from the <see cref="T:System.Collections.Generic.ICollection`1"></see>.
 /// </summary>
 /// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Generic.ICollection`1"></see> is read-only. </exception>
 public void Clear()
 {
     tree  = null;
     count = 0;
 }
Beispiel #2
0
        /// <summary>
        /// Finds the min node.
        /// </summary>
        /// <param name="startNode">The start node.</param>
        /// <param name="parent">The parent of the node found.</param>
        /// <returns>The minimum node underneath the node specified.  If the node specified is a leaf node, it is returned.</returns>
        private BinaryTree <Association <TKey, TValue> > FindMinNode(BinaryTree <Association <TKey, TValue> > startNode, out BinaryTree <Association <TKey, TValue> > parent)
        {
            #region Asserts

            Debug.Assert(startNode != null);

            #endregion

            BinaryTree <Association <TKey, TValue> > searchNode = startNode;
            parent = null;

            while (searchNode.Left != null)
            {
                parent     = searchNode;
                searchNode = searchNode.Left;
            }

            return(searchNode);
        }