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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? algorithms.cs

?? C#寫的類似于STL的集合類,首先是C#編寫,可以用于.net變程.
?? CS
?? 第 1 頁 / 共 5 頁
字號:

                    wrappedArray[index] = value;
                }
            }

            public override void CopyTo(T[] array, int arrayIndex)
            {
                if (array == null)
                    throw new ArgumentNullException("array");
                if (array.Length < wrappedArray.Length)
                    throw new ArgumentException("array is too short", "array");
                if (arrayIndex < 0 || arrayIndex >= array.Length)
                    throw new ArgumentOutOfRangeException("arrayIndex");
                if (array.Length + arrayIndex < wrappedArray.Length)
                    throw new ArgumentOutOfRangeException("arrayIndex");

                Array.Copy(wrappedArray, 0, array, arrayIndex, wrappedArray.Length);
            }

            public override IEnumerator<T> GetEnumerator()
            {
                return ((IList<T>)wrappedArray).GetEnumerator();
            }

            IEnumerator IEnumerable.GetEnumerator()
            {
                return ((IList)wrappedArray).GetEnumerator();
            }

            /// <summary>
            /// Return true, to indicate that the list is fixed size.
            /// </summary>
            bool IList.IsFixedSize
            {
                get
                {
                    return true;
                }
            }
        }

        /// <summary>
        /// <para>Creates a read-write IList&lt;T&gt; wrapper around an array. When an array is
        /// implicitely converted to an IList&lt;T&gt;, changes to the items in the array cannot
        /// be made through the interface. This method creates a read-write IList&lt;T&gt; wrapper
        /// on an array that can be used to make changes to the array. </para>
        /// <para>Use this method when you need to pass an array to an algorithms that takes an 
        /// IList&lt;T&gt; and that tries to modify items in the list. Algorithms in this class generally do not
        /// need this method, since they have been design to operate on arrays even when they
        /// are passed as an IList&lt;T&gt;.</para>
        /// </summary>
        /// <remarks>Since arrays cannot be resized, inserting an item causes the last item in the array to be automatically
        /// removed. Removing an item causes the last item in the array to be replaced with a default value (0 or null). Clearing
        /// the list causes all the items to be replaced with a default value.</remarks>
        /// <param name="array">The array to wrap.</param>
        /// <returns>An IList&lt;T&gt; wrapper onto <paramref name="array"/>.</returns>
        public static IList<T> ReadWriteList<T>(T[] array)
        {
            if (array == null)
                throw new ArgumentNullException("array");

            return new ArrayWrapper<T>(array);
        }

        #endregion Collection wrappers

        #region Replacing

        /// <summary>
        /// Replace all items in a collection equal to a particular value with another values, yielding another collection.
        /// </summary>
        /// <remarks>The default sense of equality for T is used, as defined by T's
        /// implementation of IComparable&lt;T&gt;.Equals or object.Equals.</remarks>
        /// <param name="collection">The collection to process.</param>
        /// <param name="itemFind">The value to find and replace within <paramref name="collection"/>.</param>
        /// <param name="replaceWith">The new value to replace with.</param>
        /// <returns>An new collection with the items from <paramref name="collection"/>, in the same order, 
        /// with the appropriate replacements made.</returns>
        public static IEnumerable<T> Replace<T>(IEnumerable<T> collection, T itemFind, T replaceWith)
        {
            return Replace<T>(collection, itemFind, replaceWith, EqualityComparer<T>.Default);
        }

        /// <summary>
        /// Replace all items in a collection equal to a particular value with another values, yielding another collection. A passed
        /// IEqualityComparer is used to determine equality.
        /// </summary>
        /// <param name="collection">The collection to process.</param>
        /// <param name="itemFind">The value to find and replace within <paramref name="collection"/>.</param>
        /// <param name="replaceWith">The new value to replace with.</param>
        /// <param name="equalityComparer">The IEqualityComparer&lt;T&gt; used to compare items for equality. Only the Equals method will be called.</param>
        /// <returns>An new collection with the items from <paramref name="collection"/>, in the same order, 
        /// with the appropriate replacements made.</returns>
        public static IEnumerable<T> Replace<T>(IEnumerable<T> collection, T itemFind, T replaceWith, IEqualityComparer<T> equalityComparer)
        {
            if (collection == null)
                throw new ArgumentNullException("collection");
            if (equalityComparer == null)
                throw new ArgumentNullException("equalityComparer");

            foreach (T item in collection) {
                if (equalityComparer.Equals(item, itemFind))
                    yield return replaceWith;
                else
                    yield return item;
            }
        }

        /// <summary>
        /// Replace all items in a collection that a predicate evalues at true with a value, yielding another collection. .
        /// </summary>
        /// <param name="collection">The collection to process.</param>
        /// <param name="predicate">The predicate used to evaluate items with the collection. If the predicate returns true for a particular
        /// item, the item is replaces with <paramref name="replaceWith"/>.</param>
        /// <param name="replaceWith">The new value to replace with.</param>
        /// <returns>An new collection with the items from <paramref name="collection"/>, in the same order, 
        /// with the appropriate replacements made.</returns>
        public static IEnumerable<T> Replace<T>(IEnumerable<T> collection, Predicate<T> predicate, T replaceWith)
        {
            if (collection == null)
                throw new ArgumentNullException("collection");
            if (predicate == null)
                throw new ArgumentNullException("predicate");

            foreach (T item in collection) {
                if (predicate(item))
                    yield return replaceWith;
                else
                    yield return item;
            }
        }

        /// <summary>
        /// Replace all items in a list or array equal to a particular value with another value. The replacement is done in-place, changing
        /// the list.
        /// </summary>
        /// <remarks><para>The default sense of equality for T is used, as defined by T's
        /// implementation of IComparable&lt;T&gt;.Equals or object.Equals.</para>
        /// <para>Although arrays cast to IList&lt;T&gt; are normally read-only, this method
        /// will work correctly and modify an array passed as <paramref name="list"/>.</para></remarks>
        /// <param name="list">The list or array to process.</param>
        /// <param name="itemFind">The value to find and replace within <paramref name="collection"/>.</param>
        /// <param name="replaceWith">The new value to replace with.</param>
        public static void ReplaceInPlace<T>(IList<T> list, T itemFind, T replaceWith)
        {
            ReplaceInPlace(list, itemFind, replaceWith, EqualityComparer<T>.Default);
        }

        /// <summary>
        /// Replace all items in a list or array equal to a particular value with another values.
        /// The replacement is done in-place, changing
        /// the list. A passed IEqualityComparer is used to determine equality.
        /// </summary>
        /// <remarks>Although arrays cast to IList&lt;T&gt; are normally read-only, this method
        /// will work correctly and modify an array passed as <paramref name="list"/>.</remarks>
        /// <param name="list">The list or array to process.</param>
        /// <param name="itemFind">The value to find and replace within <paramref name="collection"/>.</param>
        /// <param name="replaceWith">The new value to replace with.</param>
        /// <param name="equalityComparer">The IEqualityComparer&lt;T&gt; used to compare items for equality. Only the Equals method will be called.</param>
        public static void ReplaceInPlace<T>(IList<T> list, T itemFind, T replaceWith, IEqualityComparer<T> equalityComparer)
        {
            if (list == null)
                throw new ArgumentNullException("list");
            if (equalityComparer == null)
                throw new ArgumentNullException("equalityComparer");
            if (list is T[])
                list = new ArrayWrapper<T>((T[])list);
            if (list.IsReadOnly)
                throw new ArgumentException(Strings.ListIsReadOnly, "list");

            int listCount = list.Count;
            for (int index = 0; index < listCount; ++index) {
                if (equalityComparer.Equals(list[index], itemFind))
                    list[index] = replaceWith;
            }
        }

        /// <summary>
        /// Replace all items in a list or array that a predicate evaluates at true with a value. The replacement is done in-place, changing
        /// the list.
        /// </summary>
        /// <remarks>Although arrays cast to IList&lt;T&gt; are normally read-only, this method
        /// will work correctly and modify an array passed as <paramref name="list"/>.</remarks>
        /// <param name="list">The list or array to process.</param>
        /// <param name="predicate">The predicate used to evaluate items with the collection. If the predicate returns true for a particular
        /// item, the item is replaces with <paramref name="replaceWith"/>.</param>
        /// <param name="replaceWith">The new value to replace with.</param>
        public static void ReplaceInPlace<T>(IList<T> list, Predicate<T> predicate, T replaceWith)
        {
            if (list == null)
                throw new ArgumentNullException("list");
            if (predicate == null)
                throw new ArgumentNullException("predicate");
            if (list is T[])
                list = new ArrayWrapper<T>((T[])list);
            if (list.IsReadOnly)
                throw new ArgumentException(Strings.ListIsReadOnly, "list");

            int listCount = list.Count;
            for (int index = 0; index < listCount; ++index) {
                if (predicate(list[index]))
                    list[index] = replaceWith;
            }
        }

        #endregion Replacing

        #region Consecutive items

        /// <summary>
        /// Remove consecutive equal items from a collection, yielding another collection. In each run of consecutive equal items
        /// in the collection, all items after the first item in the run are removed. 
        /// </summary>
        /// <remarks>The default sense of equality for T is used, as defined by T's
        /// implementation of IComparable&lt;T&gt;.Equals or object.Equals.</remarks>
        /// <param name="collection">The collection to process.</param>
        /// <returns>An new collection with the items from <paramref name="collection"/>, in the same order, 
        /// with consecutive duplicates removed.</returns>
        /// <exception cref="ArgumentNullException"><paramref name="collection"/> is null.</exception>
        public static IEnumerable<T> RemoveDuplicates<T>(IEnumerable<T> collection)
        {
            return RemoveDuplicates<T>(collection, EqualityComparer<T>.Default);
        }

        /// <summary>
        /// Remove consecutive equal items from a collection, yielding another collection. In each run of consecutive equal items
        /// in the collection, all items after the first item in the run are removed. A passed
        /// IEqualityComparer is used to determine equality.
        /// </summary>
        /// <param name="collection">The collection to process.</param>
        /// <param name="equalityComparer">The IEqualityComparer&lt;T&gt; used to compare items for equality. Only the Equals method will be called.</param>
        /// <returns>An new collection with the items from <paramref name="collection"/>, in the same order, 
        /// with consecutive duplicates removed.</returns>
        /// <exception cref="ArgumentNullException"><paramref name="collection"/> or <paramref name="equalityComparer"/> is null.</exception>
        public static IEnumerable<T> RemoveDuplicates<T>(IEnumerable<T> collection, IEqualityComparer<T> equalityComparer)
        {
            if (equalityComparer == null)
                throw new ArgumentNullException("equalityComparer");

            return RemoveDuplicates<T>(collection, equalityComparer.Equals);

        }

        /// <summary>
        /// Remove consecutive "equal" items from a collection, yielding another collection. In each run of consecutive equal items
        /// in the collection, all items after the first item in the run are removed. The passed 
        /// BinaryPredicate is used to determine if two items are "equal".
        /// </summary>
        /// <remarks>Since an arbitrary BinaryPredicate is passed to this function, what is being removed need not be true equality. </remarks>
        /// <param name="collection">The collection to process.</param>
        /// <param name="predicate">The BinaryPredicate used to compare items for "equality". An item <c>current</c> is removed if <c>predicate(first, current)==true</c>, where
        /// <c>first</c> is the first item in the group of "duplicate" items.</param>
        /// <returns>An new collection with the items from <paramref name="collection"/>, in the same order, 
        /// with consecutive "duplicates" removed.</returns>
        public static IEnumerable<T> RemoveDuplicates<T>(IEnumerable<T> collection, BinaryPredicate<T> predicate)
        {
            if (collection == null)
                throw new ArgumentNullException("collection");
            if (predicate == null)
                throw new ArgumentNullException("predicate");

            T current = default(T);
            bool atBeginning = true;

            foreach (T item in collection) {
                // Is the new item different from the current item?
                if (atBeginning || !predicate(current, item)) {
                    current = item;
                    yield return item;
                }

                atBeginning = false;
            }
        }

        /// <summary>
        /// Remove consecutive equal items from a list or array. In each run of consecutive equal items
        /// in the list, all items after the first item in the run are removed. The removal is done in-place, changing
        /// the list. 
        /// </summary>
        /// <remarks><para>The default sense of equality for T is used, as defined by T's
        /// implementation of IComparable&lt;T&gt;.Equals or object.Equals.</para>
        /// <para>Although arrays cast to IList&lt;T&gt; are normally read-only, this method
        /// will work correctly and modify an array passed as <paramref name="list"/>.</para></remarks>
        /// <param name="list">The list or array to process.</param>
        public static void RemoveDuplicatesInPlace<T>(IList<T> list)
        {
            RemoveDuplicatesInPlace<T>(list, EqualityComparer<T>.Default);
        }

        /// <summary>
        /// Remove subsequent consecutive equal items from a list or array. In each run of consecutive equal items
        /// in the list, all items after the first item in the run are removed.
        /// The replacement is done in-place, changing
        /// the list. A passed IEqualityComparer is used to determine equality.
        /// </summary>
        /// <remarks>Although arrays cast to IList&lt;T&gt; are normally read-only, this method
        /// will work corre

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线亚洲一区观看| 狠狠久久亚洲欧美| 欧美理论在线播放| 日韩激情一二三区| 91麻豆精品国产91久久久久久久久| 亚洲资源中文字幕| 欧美一区二区在线免费播放| 美女视频黄频大全不卡视频在线播放| 欧美在线视频不卡| 日韩精品福利网| 精品国产一区a| 久久香蕉国产线看观看99| 成人免费视频免费观看| 国产片一区二区三区| 色欲综合视频天天天| 日本欧美韩国一区三区| 欧美精彩视频一区二区三区| 日韩无一区二区| 亚洲成年人网站在线观看| 精品av久久707| 色综合天天在线| 激情偷乱视频一区二区三区| 亚洲三级免费电影| 日韩欧美国产综合在线一区二区三区 | 国产精选一区二区三区| 国产精品三级视频| 精品成人私密视频| 欧美亚洲国产一区二区三区| 久久av老司机精品网站导航| 亚洲欧美日韩在线不卡| 久久久久久一级片| 91精品国产一区二区人妖| 97久久超碰国产精品| 国产乱淫av一区二区三区| 亚洲成人av一区二区三区| 1024国产精品| 久久综合色综合88| 精品伦理精品一区| 日韩免费在线观看| 777午夜精品免费视频| 欧美伊人久久久久久久久影院 | 色综合久久综合| 国产91精品精华液一区二区三区| 午夜av一区二区| 亚洲第一成年网| 亚洲va天堂va国产va久| 亚洲午夜久久久久久久久电影院 | 成人av午夜电影| 9i看片成人免费高清| 成人av资源网站| 99久久精品国产精品久久| 成人午夜电影小说| av一区二区三区四区| 91污片在线观看| 91国产精品成人| 欧美一二三在线| 日韩精品一区二区在线| 日韩欧美国产电影| 精品国产乱码久久久久久1区2区 | 一区二区三区在线高清| 亚洲日本护士毛茸茸| 亚洲国产cao| 亚洲一区av在线| 午夜欧美在线一二页| 亚洲超碰97人人做人人爱| 图片区日韩欧美亚洲| 久久99精品国产麻豆婷婷| 不卡免费追剧大全电视剧网站| 69久久99精品久久久久婷婷 | 蜜臀精品久久久久久蜜臀 | 国产精品污网站| 专区另类欧美日韩| 日韩国产一二三区| 国产麻豆日韩欧美久久| 色综合天天综合狠狠| 欧美电影在哪看比较好| 久久久久国产一区二区三区四区| 国产精品日产欧美久久久久| 亚洲精品中文在线观看| 奇米888四色在线精品| 懂色av中文字幕一区二区三区| 欧美性猛交一区二区三区精品| 欧美成人综合网站| 亚洲精品一卡二卡| 精品一区二区日韩| 欧美图片一区二区三区| 极品美女销魂一区二区三区免费| 精品国产三级a在线观看| 亚洲欧洲韩国日本视频| 蜜桃av一区二区| 欧美系列一区二区| 国产精品电影一区二区三区| 美国三级日本三级久久99| 91浏览器在线视频| 中国av一区二区三区| 久久99国产精品麻豆| 91成人在线免费观看| 国产精品丝袜黑色高跟| 国产另类ts人妖一区二区| 日韩欧美黄色影院| 麻豆免费看一区二区三区| 欧美人伦禁忌dvd放荡欲情| 亚洲婷婷综合色高清在线| 成人午夜精品在线| 欧美精彩视频一区二区三区| 国产精品一二三| 久久久久久久综合色一本| 久久99国产乱子伦精品免费| 日韩美女一区二区三区四区| 日韩国产一二三区| 欧美成人a视频| 韩日精品视频一区| 国产三级精品三级在线专区| 国产成人激情av| 中文字幕av不卡| 国产成人超碰人人澡人人澡| 亚洲精品在线免费观看视频| 欧美日韩国产三级| 国产亚洲视频系列| 看片的网站亚洲| 91精品国产全国免费观看| 丝袜美腿高跟呻吟高潮一区| 在线电影欧美成精品| 免费精品视频最新在线| 欧美成人免费网站| 国产成人在线视频免费播放| 国产色一区二区| 色悠悠亚洲一区二区| 亚洲免费av高清| 欧美一区二区三区在线电影| 韩国精品一区二区| 国产精品第一页第二页第三页| 91网上在线视频| 石原莉奈一区二区三区在线观看| 日韩一级完整毛片| 国产1区2区3区精品美女| 一区二区三区不卡视频在线观看| 日韩欧美一区中文| 91免费国产视频网站| 视频在线观看国产精品| 国产日韩三级在线| 在线观看亚洲精品| 国产盗摄一区二区| 五月天欧美精品| 国产精品久久久久国产精品日日| 欧美日韩亚洲高清一区二区| 国内一区二区在线| 亚洲夂夂婷婷色拍ww47| 久久久精品中文字幕麻豆发布| 欧美偷拍一区二区| 91蜜桃在线观看| 国产剧情一区二区| 蜜桃av一区二区三区电影| 国产欧美日韩另类一区| 在线精品视频小说1| 成人久久久精品乱码一区二区三区 | 欧美日韩精品综合在线| 国产成+人+日韩+欧美+亚洲| 丝袜美腿亚洲一区| 亚洲r级在线视频| 一区二区三区欧美日韩| 久久九九全国免费| 久久精品亚洲乱码伦伦中文| 欧美猛男男办公室激情| 欧美亚洲动漫制服丝袜| 91视频你懂的| 91一区二区三区在线播放| 国产精品一区免费视频| 国产一区欧美一区| 国产精品亚洲专一区二区三区| 蜜桃视频免费观看一区| 男女视频一区二区| 麻豆久久久久久| 激情五月婷婷综合| 国产精品白丝av| 日韩中文字幕1| 日韩av电影免费观看高清完整版 | 国产一区二三区好的| 精品第一国产综合精品aⅴ| 日韩欧美黄色影院| 久久久久久亚洲综合影院红桃| 91精品欧美综合在线观看最新| 91精品国产麻豆国产自产在线| 欧美精品777| 精品久久久久久久久久久久久久久 | 亚洲国产精品成人综合色在线婷婷| 久久久一区二区| 中文字幕av一区二区三区| 亚洲日本在线a| 亚洲1区2区3区4区| 极品少妇xxxx精品少妇偷拍| 成人精品免费看| 欧美亚洲另类激情小说| 日韩午夜av一区| 国产精品私人自拍| 免费成人结看片| 成人性色生活片| 91在线观看下载| 日韩午夜激情av| 亚洲美女屁股眼交3|