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

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

?? orderedbag.cs

?? C#寫的類似于STL的集合類,首先是C#編寫,可以用于.net變程.
?? CS
?? 第 1 頁 / 共 5 頁
字號:
        {
            T item;
            CheckEmpty();
            tree.LastItemInRange(tree.EntireRangeTester, out item);
            return item;
        }

        /// <summary>
        /// Removes the first item in the bag. This is also the smallest
        /// item in the bag.
        /// </summary>
        /// <remarks>RemoveFirst() takes time O(log N), where N is the number of items in the bag.</remarks>
        /// <returns>The item that was removed, which was the smallest item in the bag. </returns>
        /// <exception cref="InvalidOperationException">The bag is empty.</exception>
        public T RemoveFirst()
        {
            CheckEmpty();
            T item;
            tree.DeleteItemFromRange(tree.EntireRangeTester, true, out item);
            return item;
        }

        /// <summary>
        /// Removes the last item in the bag. This is also the largest item in the bag.
        /// </summary>
        /// <remarks>RemoveLast() takes time O(log N), where N is the number of items in the bag.</remarks>
        /// <returns>The item that was removed, which was the largest item in the bag. </returns>
        /// <exception cref="InvalidOperationException">The bag is empty.</exception>
        public T RemoveLast()
        {
            CheckEmpty();
            T item;
            tree.DeleteItemFromRange(tree.EntireRangeTester, false, out item);
            return item;
        }

        #endregion

        #region Set operations

        /// <summary>
        /// Check that this bag and another bag were created with the same comparison
        /// mechanism. Throws exception if not compatible.
        /// </summary>
        /// <param name="otherBag">Other bag to check comparision mechanism.</param>
        /// <exception cref="InvalidOperationException">If otherBag and this bag don't use the same method for comparing items.</exception>
        /// <exception cref="ArgumentNullException"><paramref name="otherBag"/> is null.</exception>
        private void CheckConsistentComparison(OrderedBag<T> otherBag)
        {
            if (otherBag == null)
                throw new ArgumentNullException("otherBag");

            if (!object.Equals(comparer, otherBag.comparer))
                throw new InvalidOperationException(Strings.InconsistentComparisons);
        }

        /// <summary>
        /// Determines if this bag is a superset of another bag. Neither bag is modified.
        /// This bag is a superset of <paramref name="otherBag"/> if every element in
        /// <paramref name="otherBag"/> is also in this bag, at least the same number of
        /// times.
        /// </summary>
        /// <remarks>IsSupersetOf is computed in time O(M log N), where M is the size of the 
        /// <paramref name="otherSet"/>, and N is the size of the this set.</remarks>
        /// <param name="otherBag">OrderedBag to compare to.</param>
        /// <returns>True if this is a superset of <paramref name="otherBag"/>.</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 bool IsSupersetOf(OrderedBag<T> otherBag)
        {
            CheckConsistentComparison(otherBag);

            if (otherBag.Count > this.Count)
                return false;     // Can't be a superset of a bigger bag

            // Check each item in the other bag to make sure it is in this bag.
            foreach (T item in otherBag.DistinctItems()) {
                if (this.NumberOfCopies(item) < otherBag.NumberOfCopies(item))
                    return false;
            }

            return true;
        }

        /// <summary>
        /// Determines if this bag is a proper superset of another bag. Neither bag is modified.
        /// This bag is a proper superset of <paramref name="otherBag"/> if every element in
        /// <paramref name="otherBag"/> is also in this bag, at least the same number of
        /// times. Additional, this bag must have strictly more items than <paramref name="otherBag"/>.
        /// </summary>
        /// <remarks>IsProperSupersetOf is computed in time O(M log N), where M is the number of unique items in 
        /// <paramref name="otherBag"/>.</remarks>
        /// <param name="otherBag">OrderedBag to compare to.</param>
        /// <returns>True if this is a proper superset of <paramref name="otherBag"/>.</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 bool IsProperSupersetOf(OrderedBag<T> otherBag)
        {
            CheckConsistentComparison(otherBag);

            if (otherBag.Count >= this.Count)
                return false;     // Can't be a proper superset of a bigger or equal set

            return IsSupersetOf(otherBag);
        }

        /// <summary>
        /// Determines if this bag is a subset of another bag. Neither bag is modified.
        /// This bag is a subset of <paramref name="otherBag"/> if every element in this bag
        /// is also in <paramref name="otherBag"/>, at least the same number of
        /// times.
        /// </summary>
        /// <remarks>IsSubsetOf is computed in time O(N log M), where M is the size of the 
        /// <paramref name="otherBag"/>, and N is the size of the this bag.</remarks>
        /// <param name="otherBag">OrderedBag to compare to.</param>
        /// <returns>True if this is a subset of <paramref name="otherBag"/>.</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 bool IsSubsetOf(OrderedBag<T> otherBag)
        {
            return otherBag.IsSupersetOf(this);
        }

        /// <summary>
        /// Determines if this bag is a proper subset of another bag. Neither bag is modified.
        /// This bag is a subset of <paramref name="otherBag"/> if every element in this bag
        /// is also in <paramref name="otherBag"/>, at least the same number of
        /// times. Additional, this bag must have strictly fewer items than <paramref name="otherBag"/>.
        /// </summary>
        /// <remarks>IsSubsetOf is computed in time O(N log M), where M is the size of the 
        /// <paramref nameb="otherBag"/>, and N is the size of the this bag.</remarks>
        /// <param name="otherBag">OrderedBag to compare to.</param>
        /// <returns>True if this is a proper subset of <paramref name="otherBag"/>.</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 bool IsProperSubsetOf(OrderedBag<T> otherBag)
        {
            return otherBag.IsProperSupersetOf(this);
        }

        /// <summary>
        /// Determines if this bag is disjoint from another bag. Two bags are disjoint
        /// if no item from one set is equal to any item in the other bag.
        /// </summary>
        /// <remarks>
        /// <para>The answer is computed in time O(N), where N is the size of the smaller set.</para>
        /// </remarks>
        /// <param name="otherBag">Bag to check disjointness with.</param>
        /// <returns>True if the two bags are disjoint, false otherwise.</returns>
        /// <exception cref="InvalidOperationException">This bag and <paramref name="otherBag"/> don't use the same method for comparing items.</exception>
        public bool IsDisjointFrom(OrderedBag<T> otherBag)
        {
            CheckConsistentComparison(otherBag);
            OrderedBag<T> smaller, larger;
            if (otherBag.Count > this.Count) {
                smaller = this; larger = otherBag;
            }
            else {
                smaller = otherBag; larger = this;
            }

            foreach (T item in smaller) {
                if (larger.Contains(item))
                    return false;
            }

            return true;
        }
            
        /// <summary>
        /// Determines if this bag is equal to another bag. This bag is equal to
        /// <paramref name="otherBag"/> if they contain the same items, each the
        /// same number of times.
        /// </summary>
        /// <remarks>IsEqualTo is computed in time O(N), where N is the number of items in 
        /// this bag.</remarks>
        /// <param name="otherBag">OrderedBag to compare to</param>
        /// <returns>True if this bag is equal to <paramref name="otherBag"/>, false otherwise.</returns>
        /// <exception cref="InvalidOperationException">This bag and <paramref name="otherBag"/> don't use the same method for comparing items.</exception>
        public bool IsEqualTo(OrderedBag<T> otherBag)
        {
            CheckConsistentComparison(otherBag);

            // Must be the same size.
            if (otherBag.Count != this.Count)
                return false;

            // Since both bags are ordered, we can simply compare items in order.
            using (IEnumerator<T> enum1 = this.GetEnumerator(), enum2 = otherBag.GetEnumerator()) {
                bool continue1, continue2;

                for (; ; ) {
                    continue1 = enum1.MoveNext(); continue2 = enum2.MoveNext();
                    if (!continue1 || !continue2)
                        break;

                    if (comparer.Compare(enum1.Current, enum2.Current) != 0)
                        return false;     // the two items are not equal.
                }

                // If both continue1 and continue2 are false, we reached the end of both sequences at the same
                // time and found success. If one is true and one is false, the sequences were of difference lengths -- failure.
                return (continue1 == continue2);
            }
        }

        /// <summary>
        /// Computes the union of this bag with another bag. The union of two bags
        /// is all items from both of the bags. If an item appears X times in one bag,
        /// and Y times in the other bag, the union contains the item Maximum(X,Y) times. This bag receives
        /// the union of the two bags, the other bag is unchanged.
        /// </summary>
        /// <remarks>
        /// <para>The union of two bags is computed in time O(M + N log M), 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 union with.</param>
        /// <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 void UnionWith(OrderedBag<T> otherBag)
        {
            CheckConsistentComparison(otherBag);

            T previous = default(T);
            bool atBeginning = true;
            int copiesInThis = 0, copiesInOther = 0;

            // Enumerate each of the items in the other bag. Add items that need to be
            // added to this bag.
            // CONSIDER: may be able to improve this algorithm if otherBag is larger than this bag.
            foreach (T item in otherBag) {
                if (atBeginning || comparer.Compare(item, previous) != 0) {
                    copiesInThis = this.NumberOfCopies(item);
                    copiesInOther = 1;
                }
                else {
                    ++copiesInOther;
                }

                if (copiesInOther > copiesInThis)
                    this.Add(item);

                previous = item;
                atBeginning = false;
            }
        }

        /// <summary>
        /// Computes the union of this bag with another bag. The union of two bags
        /// is all items from both of the bags.  If an item appears X times in one bag,
        /// and Y times in the other bag, the union contains the item Maximum(X,Y) times. A new bag is 
        /// created with the union of the bags and is returned. This bag and the other bag 
        /// are unchanged.
        /// </summary>
        /// <remarks>
        /// <para>The union of two bags is computed in time O(M + N log M), 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 union with.</param>
        /// <returns>The union 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> Union(OrderedBag<T> otherBag)
        {
            CheckConsistentComparison(otherBag);
            OrderedBag<T> smaller, larger, result;
            if (otherBag.Count > this.Count) {
                smaller = this; larger = otherBag;
            }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品每日更新| 日本乱人伦一区| 国产亚洲自拍一区| 国产成人8x视频一区二区| 国产欧美精品一区| 91浏览器在线视频| 亚洲二区视频在线| 91精品国产综合久久蜜臀| 久久99热99| 国产精品青草久久| 91麻豆免费在线观看| 亚洲成a人在线观看| 日韩欧美一区二区不卡| 国产高清精品网站| 亚洲免费观看视频| 欧美一区二区三区爱爱| 韩国成人精品a∨在线观看| 中文一区在线播放| 91国产丝袜在线播放| 日韩国产高清在线| 国产调教视频一区| 欧亚一区二区三区| 麻豆freexxxx性91精品| 国产日韩欧美精品综合| 色天天综合久久久久综合片| 日本vs亚洲vs韩国一区三区| 国产欧美一区二区精品忘忧草 | 国产婷婷色一区二区三区| 91亚洲精品一区二区乱码| 视频在线在亚洲| 国产无一区二区| 欧美性一区二区| 国产原创一区二区| 亚洲精品乱码久久久久久久久| 欧美一区二区三区人| 国产成人精品影视| 亚洲午夜精品网| 26uuu另类欧美亚洲曰本| 色呦呦国产精品| 麻豆精品国产91久久久久久| 国产精品美日韩| 91精品国产综合久久精品app | 亚洲女同一区二区| 日韩欧美精品在线视频| aaa欧美色吧激情视频| 午夜精品爽啪视频| 国产精品色噜噜| 欧美一级精品在线| 91免费看`日韩一区二区| 免费的成人av| 亚洲精品免费在线播放| 2023国产一二三区日本精品2022| 9i在线看片成人免费| 日韩在线一二三区| 亚洲人成精品久久久久| 精品久久久久久最新网址| 欧洲亚洲国产日韩| 国产盗摄一区二区三区| 水野朝阳av一区二区三区| 国产精品国产三级国产aⅴ中文| 欧美一二三区在线| 日本电影欧美片| 丰满白嫩尤物一区二区| 日韩二区在线观看| 一区二区在线观看不卡| 国产欧美一区二区精品忘忧草| 欧美一区二区国产| 欧美影院一区二区| 99久久国产综合色|国产精品| 久久精品99国产国产精| 亚洲国产精品久久久久婷婷884| 国产欧美一二三区| 亚洲精品一区二区三区99| 欧美男同性恋视频网站| 91美女蜜桃在线| 成人av在线资源| 国产精品一区一区三区| 免费高清在线一区| 亚洲成人免费影院| 亚洲精品视频观看| 亚洲人成亚洲人成在线观看图片| 久久久精品影视| 精品剧情在线观看| 日韩一区二区三区免费看 | 久久久久久久久久看片| 欧美一激情一区二区三区| 欧美日韩三级在线| 91久久人澡人人添人人爽欧美| 国产91精品入口| 国产美女精品人人做人人爽| 欧美a一区二区| 午夜欧美视频在线观看 | 琪琪久久久久日韩精品| 香蕉久久夜色精品国产使用方法| 亚洲日本va在线观看| 亚洲国产精品国自产拍av| 26uuu国产电影一区二区| 日韩一区二区三区免费观看| 在线电影国产精品| 在线不卡中文字幕| 欧美精品日日鲁夜夜添| 欧美探花视频资源| 色嗨嗨av一区二区三区| 一本大道av一区二区在线播放| www.欧美日韩国产在线| 成人h版在线观看| k8久久久一区二区三区| av不卡在线播放| 色综合久久天天| 色成人在线视频| 色猫猫国产区一区二在线视频| 91老司机福利 在线| 日本韩国精品在线| 欧美日韩一区二区在线观看视频| 欧美午夜精品一区| 精品视频一区二区不卡| 欧美另类一区二区三区| 欧美一区二区在线视频| 日韩亚洲欧美一区| 精品乱码亚洲一区二区不卡| 精品国产99国产精品| 久久久不卡网国产精品二区| 国产日韩av一区| 国产精品你懂的在线欣赏| 亚洲视频一二区| 一二三四区精品视频| 亚洲成av人**亚洲成av**| 亚洲va欧美va人人爽| 香蕉乱码成人久久天堂爱免费| 免费成人你懂的| 精彩视频一区二区| 成人深夜视频在线观看| 91香蕉视频污在线| 欧美日韩视频在线第一区| 日韩一区二区三区电影| 久久久综合精品| 亚洲欧洲美洲综合色网| 亚洲最大成人综合| 蜜臀精品久久久久久蜜臀| 国产一区二区三区四区五区入口| 国产成人在线色| 99免费精品在线观看| 欧美日韩一区久久| 精品国产电影一区二区| 国产精品久久免费看| 一二三四社区欧美黄| 久久av中文字幕片| 成人av午夜电影| 91成人看片片| 欧美一区二区三区视频免费 | 在线免费av一区| 日韩精品专区在线影院重磅| 国产欧美精品在线观看| 一区二区三区高清在线| 蜜臀久久99精品久久久画质超高清| 国产69精品久久99不卡| 91久久精品一区二区| 日韩视频一区二区三区在线播放| 国产欧美一区二区三区网站| 亚洲国产精品视频| 男男视频亚洲欧美| 国产.精品.日韩.另类.中文.在线.播放 | 成人做爰69片免费看网站| 在线观看日产精品| 精品久久99ma| 伊人开心综合网| 狠狠色狠狠色综合| 一本一道综合狠狠老| 欧美一区二区三区性视频| 国产色产综合色产在线视频| 亚洲一区二区在线免费看| 久99久精品视频免费观看| 91蜜桃传媒精品久久久一区二区| 91精品国产欧美一区二区成人| 国产精品视频免费看| 日韩高清一区二区| 99久久99久久久精品齐齐| 日韩三级中文字幕| 综合激情网...| 狠狠色丁香婷婷综合| 欧洲一区二区三区在线| 欧美国产精品中文字幕| 日韩专区中文字幕一区二区| 成人av影视在线观看| 精品sm捆绑视频| 亚洲国产视频在线| 成人动漫中文字幕| 欧美成人在线直播| 亚洲午夜电影在线| 不卡电影一区二区三区| 欧美成人a视频| 亚洲一区二三区| av亚洲产国偷v产偷v自拍| 久久日韩粉嫩一区二区三区| 午夜日韩在线电影| 欧美在线观看视频一区二区三区| 久久久高清一区二区三区| 美女视频网站黄色亚洲| 一本久久精品一区二区| 国产亚洲精品aa|