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

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

?? orderedbag.cs

?? C#寫的類似于STL的集合類,首先是C#編寫,可以用于.net變程.
?? CS
?? 第 1 頁 / 共 5 頁
字號:
            else {
                smaller = otherBag; larger = this;
            }

            result = larger.Clone();
            result.UnionWith(smaller);
            return result;
        }

        /// <summary>
        /// Computes the sum of this bag with another bag. The sum 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 sum contains the item (X+Y) times. This bag receives
        /// the sum of the two bags, the other bag is unchanged.
        /// </summary>
        /// <remarks>
        /// <para>The sum 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 sum 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 SumWith(OrderedBag<T> otherBag)
        {
            CheckConsistentComparison(otherBag);

            AddMany(otherBag);

            // CONSIDER: if otherBag is much larger, maybe better to clone it,
            // add all of the current into it, and replace.
        }

        /// <summary>
        /// Computes the sum of this bag with another bag. he sum 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 sum contains the item (X+Y) times. A new bag is 
        /// created with the sum of the bags and is returned. This bag and the other bag 
        /// are unchanged.
        /// </summary>
        /// <remarks>
        /// <para>The sum 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 sum with.</param>
        /// <returns>The sum 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> Sum(OrderedBag<T> otherBag)
        {
            CheckConsistentComparison(otherBag);
            OrderedBag<T> smaller, larger, result;
            if (otherBag.Count > this.Count) {
                smaller = this; larger = otherBag;
            }
            else {
                smaller = otherBag; larger = this;
            }

            result = larger.Clone();
            result.AddMany(smaller);
            return result;
        }

        /// <summary>
        /// Computes the intersection of this bag with another bag. The intersection of two bags
        /// is all items that appear in both of the bags. If an item appears X times in one bag,
        /// and Y times in the other bag, the sum contains the item Minimum(X,Y) times. This bag receives
        /// the intersection of the two bags, the other bag is unchanged.
        /// </summary>
        /// <remarks>
        /// <para>When equal items appear in both bags, the intersection will include an arbitrary choice of one of the
        /// two equal items.</para>
        /// <para>The intersection of two bags is computed in time O(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 intersection 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 IntersectionWith(OrderedBag<T> otherBag)
        {
            CheckConsistentComparison(otherBag);
            tree.StopEnumerations();

            OrderedBag<T> smaller, larger;
            if (otherBag.Count > this.Count) {
                smaller = this; larger = otherBag;
            }
            else {
                smaller = otherBag; larger = this;
            }

            T dummy;
            RedBlackTree<T> newTree = new RedBlackTree<T>(comparer);

            T previous = default(T);
            bool atBeginning = true;
            int copiesInSmaller = 0, copiesInLarger = 0;

            // Enumerate each of the items in the smaller bag. Add items that need to be
            // added to the intersection.
            foreach (T item in smaller) {
                if (atBeginning || comparer.Compare(item, previous) != 0) {
                    copiesInLarger = larger.NumberOfCopies(item);
                    copiesInSmaller = 1;
                }
                else {
                    ++copiesInSmaller;
                }

                if (copiesInSmaller <= copiesInLarger)
                    newTree.Insert(item, DuplicatePolicy.InsertLast, out dummy);

                previous = item;
                atBeginning = false;
            }

            tree = newTree;
        }

        /// <summary>
        /// Computes the intersection of this bag with another bag. The intersection of two bags
        /// is all items that appear in both of the bags. If an item appears X times in one bag,
        /// and Y times in the other bag, the sum contains the item Minimum(X,Y) times. A new bag is 
        /// created with the intersection of the bags and is returned. This bag and the other bag 
        /// are unchanged.
        /// </summary>
        /// <remarks>
        /// <para>When equal items appear in both bags, the intersection will include an arbitrary choice of one of the
        /// two equal items.</para>
        /// <para>The intersection of two bags is computed in time O(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 intersection with.</param>
        /// <returns>The intersection 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> Intersection(OrderedBag<T> otherBag)
        {
            CheckConsistentComparison(otherBag);
            OrderedBag<T> smaller, larger, result;
            if (otherBag.Count > this.Count) {
                smaller = this; larger = otherBag;
            }
            else {
                smaller = otherBag; larger = this;
            }

            T previous = default(T);
            bool atBeginning = true;
            int copiesInSmaller = 0, copiesInLarger = 0;

            // Enumerate each of the items in the smaller bag. Add items that need to be
            // added to the intersection.
            result = new OrderedBag<T>(comparer);
            foreach (T item in smaller) {
                if (atBeginning || comparer.Compare(item, previous) != 0) {
                    copiesInLarger = larger.NumberOfCopies(item);
                    copiesInSmaller = 1;
                }
                else {
                    ++copiesInSmaller;
                }

                if (copiesInSmaller <= copiesInLarger)
                    result.Add(item);

                previous = item;
                atBeginning = false;
            }

            return result;
        }

        /// <summary>
        /// Computes the difference of this bag with another bag. The difference of these two bags
        /// is all items that appear in this bag, but not in <paramref name="otherBag"/>. If an item appears X times in this bag,
        /// and Y times in the other bag, the difference contains the item X - Y times (zero times if Y >= X). This bag receives
        /// the difference of the two bags; the other bag is unchanged.
        /// </summary>
        /// <remarks>
        /// <para>The difference 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 difference 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 DifferenceWith(OrderedBag<T> otherBag)
        {
            // Difference with myself is nothing. This check is needed because the
            // main algorithm doesn't work correctly otherwise.
            if (this == otherBag)
                Clear();

            CheckConsistentComparison(otherBag);

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

            // Enumerate each of the items in the other bag. Remove items that need to be
            // removed from this bag.
            // CONSIDER: should 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.Remove(item);

                previous = item;
                atBeginning = false;
            }

        }

        /// <summary>
        /// Computes the difference of this bag with another bag. The difference of these two bags
        /// is all items that appear in this bag, but not in <paramref name="otherBag"/>. If an item appears X times in this bag,
        /// and Y times in the other bag, the difference contains the item X - Y times (zero times if Y >= X).  A new bag is 
        /// created with the difference of the bags and is returned. This bag and the other bag 
        /// are unchanged.
        /// </summary>
        /// <remarks>
        /// <para>The difference 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 difference with.</param>
        /// <returns>The 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> Difference(OrderedBag<T> otherBag)
        {
            CheckConsistentComparison(otherBag);
            OrderedBag<T> result = this.Clone();
            result.DifferenceWith(otherBag);
            return result;
        }

        /// <summary>
        /// Computes the symmetric difference of this bag with another bag. The symmetric difference of two bags
        /// is all items that appear in either of the bags, but not both. If an item appears X times in one bag,
        /// and Y times in the other bag, the symmetric difference contains the item AbsoluteValue(X - Y times). This bag receives
        /// the symmetric difference of the two bags; the other bag is unchanged.
        /// </summary>
        /// <remarks>
        /// <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>
        /// <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 SymmetricDifferenceWith(OrderedBag<T> otherBag)
        {
            tree = SymmetricDifference(otherBag).tree;
        }

        /// <summary>
        /// Computes the symmetric difference of this bag with another bag. The symmetric difference of two bags
        /// is all items that appear in either of the bags, but not both. If an item appears X times in one bag,
        /// and Y times in the other bag, the symmetric difference contains the item AbsoluteValue(X - Y times). A new bag is 
        /// created with the symmetric difference of the bags and is returned. This bag and the other bag 
        /// are unchanged.
        /// </summary>
        /// <remarks>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧洲一区二区三区在线| 亚洲国产成人av好男人在线观看| 色老汉av一区二区三区| 成人免费毛片高清视频| 欧美一区中文字幕| 88在线观看91蜜桃国自产| 久久中文娱乐网| 欧美精品一区二区三区蜜桃| 精品国产一区二区在线观看| 日韩视频免费观看高清完整版 | 一本一道久久a久久精品综合蜜臀| 激情五月激情综合网| 国产美女在线精品| 不卡一区二区中文字幕| 色先锋久久av资源部| 欧美三级午夜理伦三级中视频| 欧美福利一区二区| 日韩美女视频在线| 国产毛片一区二区| 99久久免费国产| 欧美三级午夜理伦三级中视频| 欧美一卡二卡在线| 日韩理论片在线| 精品国产凹凸成av人导航| eeuss鲁片一区二区三区| 色天天综合色天天久久| 欧美日韩高清在线播放| 日韩精品一区二区在线观看| 日本一区二区三区在线不卡 | 在线国产亚洲欧美| 欧美一区二区高清| 成人激情av网| 欧美亚洲国产一区二区三区va | 在线观看日韩国产| 亚洲国产精品精华液ab| 在线不卡中文字幕| 国产精品久久久久久久久免费相片 | 亚洲自拍偷拍九九九| 日本aⅴ亚洲精品中文乱码| 国产99久久久精品| 亚洲国产精品一区二区久久| 久久激情综合网| 日本电影亚洲天堂一区| 久久国产尿小便嘘嘘尿| 欧亚一区二区三区| 国产日本欧洲亚洲| 美脚の诱脚舐め脚责91| 欧美性欧美巨大黑白大战| 国产欧美精品一区二区色综合朱莉| 一区二区三区产品免费精品久久75| 国产一区二区三区日韩 | 欧美国产97人人爽人人喊| 亚洲一区二区三区四区中文字幕| 国产一区91精品张津瑜| 日韩欧美亚洲国产精品字幕久久久| 亚洲激情在线播放| 国产成人aaaa| 久久久精品免费免费| 欧美aaa在线| 91精品国产黑色紧身裤美女| 亚洲最大的成人av| 久久久99精品免费观看不卡| 日韩亚洲欧美综合| 亚洲国产成人高清精品| 91丨porny丨国产入口| 中文字幕一区在线| 欧美午夜电影网| 91精品国产综合久久久久| 一区二区国产盗摄色噜噜| 91女厕偷拍女厕偷拍高清| 国产精品蜜臀av| 99re这里只有精品首页| 中文字幕av一区二区三区| 成人午夜视频在线| 中文字幕在线观看一区| av网站一区二区三区| 亚洲视频在线观看三级| 亚洲日本va午夜在线影院| 成人91在线观看| 亚洲欧美自拍偷拍色图| 99综合影院在线| 亚洲最快最全在线视频| 欧美日韩亚洲综合一区二区三区| 亚洲成人福利片| 欧美日韩成人在线一区| 天天综合日日夜夜精品| 欧美电影一区二区| 日本一区二区不卡视频| 99久久99久久综合| 一个色综合网站| 91精品国产aⅴ一区二区| 看电影不卡的网站| 国产欧美一区二区精品性色| www.色精品| 亚洲一区二区三区四区不卡| 在线播放亚洲一区| 国产精品一级黄| 亚洲美女电影在线| 91精品蜜臀在线一区尤物| 国产在线国偷精品免费看| 成人午夜大片免费观看| 有坂深雪av一区二区精品| 在线不卡欧美精品一区二区三区| 激情都市一区二区| 一区二区三区四区在线播放| 日韩亚洲欧美中文三级| aa级大片欧美| 青青草一区二区三区| 欧美一区二区三区在线电影| 成人在线一区二区三区| 亚洲国产美女搞黄色| 久久这里只有精品6| 日本高清不卡一区| 国产三级久久久| 色综合天天综合网天天看片| 欧美体内she精高潮| 另类小说综合欧美亚洲| 国产一区二区视频在线| 亚洲精品乱码久久久久久日本蜜臀| 欧美日韩在线播| 国产激情精品久久久第一区二区 | 欧美高清精品3d| 风间由美性色一区二区三区| 成人动漫视频在线| 欧美成人精品二区三区99精品| 色综合久久88色综合天天6| 韩国一区二区视频| 日韩专区中文字幕一区二区| 国产精品色哟哟| 欧美成人三级电影在线| 欧美日韩精品一二三区| 色悠悠亚洲一区二区| 国产成人av电影免费在线观看| 日韩av一级片| 亚洲成人一二三| 亚洲精品一二三区| 91麻豆精品国产自产在线观看一区| 日韩和欧美一区二区| 国产精品一区二区三区网站| 亚洲成人激情社区| 一区av在线播放| 国产精品乱人伦中文| 久久久国产一区二区三区四区小说| 91在线精品一区二区| 成人网在线免费视频| 精品在线免费视频| 一区二区三区欧美日韩| 国产精品免费av| 国产精品麻豆欧美日韩ww| 久久婷婷国产综合国色天香| 日韩欧美国产一区二区在线播放| 欧美精品日韩一区| 欧美影院一区二区| 欧美体内she精高潮| 91福利视频在线| 色欧美片视频在线观看| 日本道免费精品一区二区三区| 色香蕉成人二区免费| 亚洲天堂久久久久久久| 亚洲欧美在线高清| 国产精品色呦呦| 最新不卡av在线| 亚洲一区二区影院| 亚瑟在线精品视频| 久久精品国产一区二区三| 国产精品国产精品国产专区不片| 91久久精品午夜一区二区| 91福利视频久久久久| 欧美午夜一区二区三区| 欧美日本韩国一区二区三区视频 | 91麻豆精品国产综合久久久久久| 日韩免费性生活视频播放| 久久综合色播五月| 极品美女销魂一区二区三区免费| 国产欧美一区视频| 一区二区三区四区乱视频| 欧美tickle裸体挠脚心vk| 欧美亚洲自拍偷拍| 欧美一区二区三区免费| 国产亚洲欧美日韩在线一区| 一区二区在线观看免费视频播放| 欧美日韩一区二区三区在线看| 欧美一区二区免费观在线| 精品国产1区2区3区| 国产精品乱人伦| 午夜精品福利一区二区三区av| 精品午夜久久福利影院| 99久久精品国产导航| 制服丝袜亚洲网站| 中日韩免费视频中文字幕| 亚洲福利视频一区| 国产高清一区日本| 中文字幕中文字幕在线一区| 日韩中文欧美在线| 久久久亚洲午夜电影| 一区二区三区国产精品| 精品亚洲porn| 欧美日韩国产中文| 中文字幕一区二区三区色视频 | 欧美激情综合五月色丁香小说|