亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? orderedbag.cs

?? C#寫的類似于STL的集合類,首先是C#編寫,可以用于.net變程.
?? CS
?? 第 1 頁 / 共 5 頁
字號:
        /// <para>The symmetric difference of two bags is computed in time O(M + N), where M is the size of the 
        /// larger bag, and N is the size of the smaller bag.</para>
        /// </remarks>
        /// <param name="otherBag">Bag to symmetric difference with.</param>
        /// <returns>The symmetric difference of the two bags.</returns>
        /// <exception cref="InvalidOperationException">This bag and <paramref name="otherBag"/> don't use the same method for comparing items.</exception>
        /// <exception cref="ArgumentNullException"><paramref name="otherBag"/> is null.</exception>
        public OrderedBag<T> SymmetricDifference(OrderedBag<T> otherBag)
        {
            CheckConsistentComparison(otherBag);
            OrderedBag<T> result = new OrderedBag<T>(comparer);
            IEnumerator<T> enum1 = this.GetEnumerator(), enum2 = otherBag.GetEnumerator();

            bool valid1 = enum1.MoveNext();
            bool valid2 = enum2.MoveNext();
            int compare;
            for (;;) {
                // Which item is smaller? The end (!valid) is considered larger than any item.
                if (! valid1) {
                    if (! valid2)
                        break;
                    compare = 1;
                }
                else if (! valid2)
                    compare = -1;
                else 
                    compare = comparer.Compare(enum1.Current, enum2.Current);

                // If equal, move through both bags without adding. Otherwise, add the smaller item and advance
                // just through that bag.
                if (compare == 0) {
                    valid1 = enum1.MoveNext();
                    valid2 = enum2.MoveNext();
                }
                else if (compare < 0) {
                    result.Add(enum1.Current);
                    valid1 = enum1.MoveNext();
                }
                else { // compare > 0
                    result.Add(enum2.Current);
                    valid2 = enum2.MoveNext();
                }
            }

            return result;
        }

        #endregion Set operations

        #region Read-only list view

        /// <summary>
        /// Get a read-only list view of the items in this ordered bag. The
        /// items in the list are in sorted order, with the smallest item
        /// at index 0. This view does not copy any data, and reflects any
        /// changes to the underlying OrderedBag.
        /// </summary>
        /// <returns>A read-only IList&lt;T&gt; view onto this OrderedBag.</returns>
        public IList<T> AsList()
        {
            return new ListView(this, tree.EntireRangeTester, true, false);
        }

        /// <summary>
        /// The nested class that provides a read-only list view
        /// of all or part of the collection.
        /// </summary>
        [Serializable]
        private class ListView : ReadOnlyListBase<T>
        {
            private OrderedBag<T> myBag;
            private RedBlackTree<T>.RangeTester rangeTester;   // range tester for the range being used.
            private bool entireTree;                   // is the view the whole tree?
            private bool reversed;                     // is the view reversed?

            /// <summary>
            /// Create a new list view wrapped the given set.
            /// </summary>
            /// <param name="myBag">The ordered bag to wrap.</param>
            /// <param name="rangeTester">Range tester that defines the range being used.</param>
            /// <param name="entireTree">If true, then rangeTester defines the entire tree. Used to optimize some operations.</param>
            /// <param name="reversed">Is the view enuemerated in reverse order?</param>
            public ListView(OrderedBag<T> myBag, RedBlackTree<T>.RangeTester rangeTester, bool entireTree, bool reversed)
            {
                this.myBag = myBag;
                this.rangeTester = rangeTester;
                this.entireTree = entireTree;
                this.reversed = reversed;
            }

            public sealed override int Count
            {
                get
                {
                    if (entireTree)
                        return myBag.Count;
                    else {
                        // Note: we can't cache the result of this call because the underlying
                        // set can change, which would make the cached value incorrect.
                        return myBag.tree.CountRange(rangeTester);
                    }
                }
            }

            public sealed override T this[int index]
            {
                get
                {
                    if (entireTree) {
                        if (reversed)
                            return myBag[myBag.Count - 1 - index];
                        else
                            return myBag[index];
                    }
                    else {
                        T dummy;
                        int firstIndex = myBag.tree.FirstItemInRange(rangeTester, out dummy);
                        int lastIndex = myBag.tree.LastItemInRange(rangeTester, out dummy);
                        if (firstIndex < 0 || lastIndex < 0 || index < 0 || index >= (lastIndex - firstIndex + 1))
                            throw new ArgumentOutOfRangeException("index");

                        if (reversed)
                            return myBag[lastIndex - index];
                        else
                            return myBag[firstIndex + index];
                    }
                }
            }

            public sealed override int IndexOf(T item)
            {
                if (entireTree) {
                    if (reversed)
                        return myBag.Count - 1 - myBag.LastIndexOf(item);
                    else
                        return myBag.IndexOf(item);
                }
                else {
                    T dummy;

                    if (rangeTester(item) != 0)
                        return -1;

                    if (reversed) {
                        int indexInSet = myBag.tree.FindIndex(item, false);
                        if (indexInSet < 0)
                            return -1;
                        int indexOfEnd = myBag.tree.LastItemInRange(rangeTester, out dummy);
                        return indexOfEnd - indexInSet;

                    }
                    else {
                        int indexInSet = myBag.tree.FindIndex(item, true);
                        if (indexInSet < 0)
                            return -1;
                        int indexOfStart = myBag.tree.FirstItemInRange(rangeTester, out dummy);
                        return indexInSet - indexOfStart;
                    }
                }
            }
        }

        #endregion Read-only list view

        #region Sub-views

        /// <summary>
        /// Returns a View collection that can be used for enumerating the items in the bag in 
        /// reversed order.
        /// </summary>
        ///<remarks>
        ///<p>Typically, this method is used in conjunction with a foreach statement. For example:
        ///<code>
        /// foreach(T item in bag.Reversed()) {
        ///    // process item
        /// }
        ///</code></p>
        /// <p>If an item is added to or deleted from the bag while the View is being enumerated, then 
        /// the enumeration will end with an InvalidOperationException.</p>
        ///<p>Calling Reverse does not copy the data in the tree, and the operation takes constant time.</p>
        ///</remarks>
        /// <returns>An OrderedBag.View of items in reverse order.</returns>
        public View Reversed()   // A reversed view that can be enumerated
        {
            return new View(this, tree.EntireRangeTester, true, true);
        }

        /// <summary>
        /// Returns a View collection that can be used for enumerating a range of the items in the bag.
        /// Only items that are greater than <paramref name="from"/> and 
        /// less than <paramref name="to"/> are included. The items are enumerated in sorted order.
        /// Items equal to the end points of the range can be included or excluded depending on the
        /// <paramref name="fromInclusive"/> and <paramref name="toInclusive"/> parameters.
        /// </summary>
        ///<remarks>
        ///<p>If <paramref name="from"/> is greater than or equal to <paramref name="to"/>, the returned collection is empty. </p>
        ///<p>Typically, this method is used in conjunction with a foreach statement. For example:
        ///<code>
        /// foreach(T item in bag.Range(from, true, to, false)) {
        ///    // process item
        /// }
        ///</code></p>
        /// <p>If an item is added to or deleted from the bag while the View is being enumerated, then 
        /// the enumeration will end with an InvalidOperationException.</p>
        ///<p>Calling Range does not copy the data in the tree, and the operation takes constant time.</p>
        ///</remarks>
        /// <param name="from">The lower bound of the range.</param>
        /// <param name="fromInclusive">If true, the lower bound is inclusive--items equal to the lower bound will
        /// be included in the range. If false, the lower bound is exclusive--items equal to the lower bound will not
        /// be included in the range.</param>
        /// <param name="to">The upper bound of the range. </param>
        /// <param name="toInclusive">If true, the upper bound is inclusive--items equal to the upper bound will
        /// be included in the range. If false, the upper bound is exclusive--items equal to the upper bound will not
        /// be included in the range.</param>
        /// <returns>An OrderedBag.View of items in the given range.</returns>
        public View Range(T from, bool fromInclusive, T to, bool toInclusive)  // A partial view that can be enumerated
        {
            return new View(this, tree.DoubleBoundedRangeTester(from, fromInclusive, to, toInclusive), false, false);
        }

        /// <summary>
        /// Returns a View collection that can be used for enumerating a range of the items in the bag.
        /// Only items that are greater than (and optionally, equal to) <paramref name="from"/> are included. 
        /// The items are enumerated in sorted order. Items equal to <paramref name="from"/> can be included
        /// or excluded depending on the <paramref name="fromInclusive"/> parameter.
        /// </summary>
        ///<remarks>
        ///<p>Typically, this method is used in conjunction with a foreach statement. For example:
        ///<code>
        /// foreach(T item in bag.RangeFrom(from, true)) {
        ///    // process item
        /// }
        ///</code></p>
        /// <p>If an item is added to or deleted from the bag while the View is being enumerated, then 
        /// the enumeration will end with an InvalidOperationException.</p>
        ///<p>Calling RangeFrom does not copy the data in the tree, and the operation takes constant time.</p>
        ///</remarks>
        /// <param name="from">The lower bound of the range.</param>
        /// <param name="fromInclusive">If true, the lower bound is inclusive--items equal to the lower bound will
        /// be included in the range. If false, the lower bound is exclusive--items equal to the lower bound will not
        /// be included in the range.</param>
        /// <returns>An OrderedBag.View of items in the given range.</returns>
        public View RangeFrom(T from, bool fromInclusive)  // A partial view that can be enumerated
        {
            return new View(this, tree.LowerBoundedRangeTester(from, fromInclusive), false, false);
        }

        /// <summary>
        /// Returns a View collection that can be used for enumerating a range of the items in the bag.
        /// Only items that are less than (and optionally, equal to) <paramref name="to"/> are included. 
        /// The items are enumerated in sorted order. Items equal to <paramref name="to"/> can be included
        /// or excluded depending on the <paramref name="toInclusive"/> parameter.
        /// </summary>
        ///<remarks>
        ///<p>Typically, this method is used in conjunction with a foreach statement. For example:
        ///<code>
        /// foreach(T item in bag.RangeTo(to, false)) {
        ///    // process item
        /// }
        ///</code></p>
        /// <p>If an item is added to or deleted from the bag while the View is being enumerated, then 
        /// the enumeration will end with an InvalidOperationException.</p>
        ///<p>Calling RangeTo does not copy the data in the tree, and the operation takes constant time.</p>
        ///</remarks>
        /// <param name="to">The upper bound of the range. </param>
        /// <param name="toInclusive">If true, the upper bound is inclusive--items equal to the upper bound will
        /// be included in the range. If false, the upper bound is exclusive--items equal to the upper bound will not
        /// be inc

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品国产一区二区三| 亚洲国产人成综合网站| 成人激情小说网站| 韩日欧美一区二区三区| 91片在线免费观看| 日韩理论片在线| 99久久免费国产| 久久久久亚洲蜜桃| 日韩国产在线一| 精品视频资源站| 午夜精品福利一区二区蜜股av | 国产成人免费在线| 在线视频欧美区| 欧美国产97人人爽人人喊| 狠狠色狠狠色综合| 久久色中文字幕| 国产成人av影院| 一区二区三区四区蜜桃| 日韩一级精品视频在线观看| 成人免费av资源| 欧美片网站yy| 三级精品在线观看| 久久色成人在线| 肉肉av福利一精品导航| 精品av综合导航| 成人午夜在线播放| 国产精品毛片无遮挡高清| 91丨porny丨国产| 久久99国产乱子伦精品免费| 亚洲精品高清在线观看| 欧美图片一区二区三区| 精品一区二区三区免费观看| 久久综合色8888| 99久久精品国产毛片| 国产不卡在线播放| 亚洲欧美日韩小说| 3751色影院一区二区三区| www.成人在线| 国产美女精品人人做人人爽| 国产一区二区精品久久| 欧美一区二区三区成人| 91亚洲精品久久久蜜桃网站| 日韩精品视频网站| 国产精品国产三级国产aⅴ入口 | 久久亚洲一级片| 粉嫩在线一区二区三区视频| 国产一区二三区好的| 国产精品久久久久久久久动漫| 日韩视频在线你懂得| 成人免费视频免费观看| 一区在线观看视频| 亚洲人成亚洲人成在线观看图片| 久久免费的精品国产v∧| 欧美视频一区二| 欧美在线一二三| 日本韩国一区二区| 国产a区久久久| 精品一区二区在线观看| 日本大胆欧美人术艺术动态| 午夜精品视频一区| 国产欧美日韩精品在线| 精品日韩av一区二区| 91精品啪在线观看国产60岁| 欧美午夜免费电影| 不卡的电影网站| 国产精品久久三区| 国产精品天美传媒沈樵| 国产欧美一二三区| 亚洲免费观看在线观看| 日本91福利区| 精品一区二区国语对白| 色域天天综合网| 欧美日韩精品欧美日韩精品一综合| 欧美肥妇free| 久久精品一区二区三区不卡牛牛| 久久综合久久综合久久综合| 欧美一区二区三区免费大片| 国产精品视频看| 一区二区成人在线观看| 免费精品视频在线| 欧美变态tickle挠乳网站| 欧美手机在线视频| 欧美亚洲综合一区| 欧美国产综合色视频| 婷婷开心久久网| 一区二区三区精密机械公司| 精品系列免费在线观看| 色婷婷综合五月| 欧美日韩国产精品自在自线| 中文字幕一区二| 免费人成黄页网站在线一区二区 | 色婷婷精品大在线视频| 日韩精品一区二区三区视频播放| 亚洲国产日韩精品| av影院午夜一区| 精品久久久久久久久久久久久久久久久| 国产精品三级av在线播放| 在线观看视频一区| 国产三级精品视频| 美女爽到高潮91| 国产精品高潮久久久久无| 国产91高潮流白浆在线麻豆 | 亚洲国产aⅴ成人精品无吗| 国产精品综合视频| 国产香蕉久久精品综合网| 国产成人夜色高潮福利影视| 中文字幕av一区二区三区高| 91亚洲精品久久久蜜桃| 蜜臀av性久久久久蜜臀aⅴ| 欧美精品777| 春色校园综合激情亚洲| 一区二区三区四区在线| 日韩视频一区二区三区| 一本色道a无线码一区v| 免费国产亚洲视频| 综合久久久久综合| 欧美精品一区二| 91精品国产欧美日韩| 9人人澡人人爽人人精品| 韩国一区二区三区| 日本午夜一本久久久综合| 日本一区二区三区四区在线视频| 在线播放一区二区三区| 国产一二三精品| 欧美日本乱大交xxxxx| 国产丝袜在线精品| 欧美大度的电影原声| 9191成人精品久久| 一本大道久久a久久综合婷婷| 蜜桃av噜噜一区二区三区小说| 久久久亚洲午夜电影| 欧美专区日韩专区| 色婷婷亚洲婷婷| 99久久久久免费精品国产 | 高清日韩电视剧大全免费| 亚洲欧洲成人精品av97| 欧美一区二区在线免费观看| 91网站最新网址| 91麻豆123| 91精品国产一区二区| 777午夜精品免费视频| 精品视频一区 二区 三区| 成人毛片在线观看| 裸体在线国模精品偷拍| 美女性感视频久久| 成人久久18免费网站麻豆 | 久久精品国产一区二区| 欧美精品一区二区三区在线| 亚洲图片欧美色图| 亚洲午夜一二三区视频| 国产一区二区伦理片| 全部av―极品视觉盛宴亚洲| 亚洲狠狠丁香婷婷综合久久久| 亚洲一区二区三区在线播放| 日韩中文字幕亚洲一区二区va在线 | 欧美国产1区2区| 中文字幕免费一区| 樱花影视一区二区| 亚洲精品乱码久久久久久 | 日韩中文字幕一区二区三区| 麻豆91精品91久久久的内涵| 色综合久久99| 精品欧美乱码久久久久久| 国产日产欧美一区| 亚洲国产综合人成综合网站| 五月天婷婷综合| 高清不卡一区二区在线| 欧美日韩中文国产| 91在线丨porny丨国产| 一色屋精品亚洲香蕉网站| 经典一区二区三区| thepron国产精品| 99r国产精品| 中文文精品字幕一区二区| 亚洲影视在线观看| 丁香啪啪综合成人亚洲小说| 成人理论电影网| 91精品国产综合久久精品app| 国产精品毛片a∨一区二区三区| 免费久久精品视频| 欧美成人精品1314www| 日韩电影在线一区二区三区| 在线观看视频一区二区| 亚洲手机成人高清视频| 99久久精品免费看| 国产亚洲欧美一级| 丝袜亚洲精品中文字幕一区| 欧美麻豆精品久久久久久| 午夜精品免费在线观看| 欧美日韩一区二区三区视频| 樱桃国产成人精品视频| 欧美久久久影院| 国产伦精品一区二区三区免费| 精品免费国产二区三区| 国产原创一区二区| 精品理论电影在线| 高清不卡一区二区| 午夜精品国产更新| 久久欧美中文字幕| 成人伦理片在线|