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

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

?? algorithms.cs

?? C#寫的類似于STL的集合類,首先是C#編寫,可以用于.net變程.
?? CS
?? 第 1 頁 / 共 5 頁
字號:
?//******************************
// Written by Peter Golde
// Copyright (c) 2004-2005, Wintellect
//
// Use and restribution of this code is subject to the license agreement 
// contained in the file "License.txt" accompanying this file.
//******************************

using System;
using System.Collections;
using System.Collections.Generic;

#pragma warning disable 419  // Ambigious cref in XML comment

// Make internals of this library available to the unit test framework.
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("UnitTests")]

// Everything should be CLS compliant.
[assembly: CLSCompliant(true)]


namespace Wintellect.PowerCollections
{
    /// <summary>
    /// The BinaryPredicate delegate type  encapsulates a method that takes two
    /// items of the same type, and returns a boolean value representating 
    /// some relationship between them. For example, checking whether two
    /// items are equal or equivalent is one kind of binary predicate.
    /// </summary>
    /// <param name="item1">The first item.</param>
    /// <param name="item2">The second item.</param>
    /// <returns>Whether item1 and item2 satisfy the relationship that the BinaryPredicate defines.</returns>
    public delegate bool BinaryPredicate<T>(T item1, T item2);

    /// <summary>
    /// Algorithms contains a number of static methods that implement
    /// algorithms that work on collections. Most of the methods deal with
    /// the standard generic collection interfaces such as IEnumerable&lt;T&gt;,
    /// ICollection&lt;T&gt; and IList&lt;T&gt;.
    /// </summary>
    public static class Algorithms
    {
        #region Collection wrappers

        /// <summary>
        /// The class that is used to implement IList&lt;T&gt; to view a sub-range
        /// of a list. The object stores a wrapped list, and a start/count indicating
        /// a sub-range of the list. Insertion/deletions through the sub-range view
        /// cause the count to change also; insertions and deletions directly on
        /// the wrapped list do not.
        /// </summary>
        [Serializable]
        private class ListRange<T> : ListBase<T>, ICollection<T>
        {
            private IList<T> wrappedList;
            private int start;
            private int count;

            /// <summary>
            /// Create a sub-range view object on the indicate part 
            /// of the list.
            /// </summary>
            /// <param name="wrappedList">List to wrap.</param>
            /// <param name="start">The start index of the view in the wrapped list.</param>
            /// <param name="count">The number of items in the view.</param>
            public ListRange(IList<T> wrappedList, int start, int count)
            {
                this.wrappedList = wrappedList;
                this.start = start;
                this.count = count;
            }

            public override int Count
            {
                get { 
                    return Math.Min(count, wrappedList.Count - start); 
                }
            }

            public override void Clear()
            {
                if (wrappedList.Count - start < count)
                    count = wrappedList.Count - start;

                while (count > 0) {
                    wrappedList.RemoveAt(start + count - 1);
                    --count;
                }
            }

            public override void Insert(int index, T item)
            {
                if (index < 0 || index > count)
                    throw new ArgumentOutOfRangeException("index");

                wrappedList.Insert(start + index, item);
                ++count;
            }

            public override void RemoveAt(int index)
            {
                if (index < 0 || index >= count)
                    throw new ArgumentOutOfRangeException("index");

                wrappedList.RemoveAt(start + index);
                --count;
            }

            public override bool Remove(T item)
            {
                if (wrappedList.IsReadOnly)
                    throw new NotSupportedException(string.Format(Strings.CannotModifyCollection, "Range"));
                else
                    return base.Remove(item);
            }

            public override T this[int index]
            {
                get
                {
                    if (index < 0 || index >= count)
                        throw new ArgumentOutOfRangeException("index");

                    return wrappedList[start + index];
                }
                set
                {
                    if (index < 0 || index >= count)
                        throw new ArgumentOutOfRangeException("index");

                    wrappedList[start + index] = value;
                }
            }

            bool ICollection<T>.IsReadOnly
            {
                get
                {
                    return wrappedList.IsReadOnly;
                }
            }
        }

        /// <summary>
        /// Returns a view onto a sub-range of a list. Items from <paramref name="list"/> are not copied; the
        /// returned IList&lt;T&gt; is simply a different view onto the same underlying items. Changes to <paramref name="list"/>
        /// are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the 
        /// view, but insertions and deletions in the underlying list do not.
        /// </summary>
        /// <remarks>This method can be used to apply an algorithm to a portion of a list. For example:
        /// <code>Algorithms.ReverseInPlace(Algorithms.Range(list, 3, 6))</code>
        /// will reverse the 6 items beginning at index 3.</remarks>
        /// <typeparam name="T">The type of the items in the list.</typeparam>
        /// <param name="list">The list to view.</param>
        /// <param name="start">The starting index of the view.</param>
        /// <param name="count">The number of items in the view.</param>
        /// <returns>A list that is a view onto the given sub-list. </returns>
        /// <exception cref="ArgumentNullException"><paramref name="list"/> is null.</exception>
        /// <exception cref="ArgumentOutOfRangeException"><paramref name="start"/> or <paramref name="count"/> is negative.</exception>
        /// <exception cref="ArgumentOutOfRangeException"><paramref name="start"/> + <paramref name="count"/> is greater than the
        /// size of <paramref name="list"/>.</exception>
        public static IList<T> Range<T>(IList<T> list, int start, int count)
        {
            if (list == null)
                throw new ArgumentOutOfRangeException("list");
            if (start < 0 || start > list.Count || (start == list.Count && count != 0))
                throw new ArgumentOutOfRangeException("start");
            if (count < 0 || count > list.Count || count + start > list.Count)
                throw new ArgumentOutOfRangeException("count");

            return new ListRange<T>(list, start, count);
        }

        /// <summary>
        /// The class that is used to implement IList&lt;T&gt; to view a sub-range
        /// of an array. The object stores a wrapped array, and a start/count indicating
        /// a sub-range of the array. Insertion/deletions through the sub-range view
        /// cause the count to change up to the size of the underlying array. Elements
        /// fall off the end of the underlying array.
        /// </summary>
        [Serializable]
        private class ArrayRange<T> : ListBase<T>
        {
            private T[] wrappedArray;
            private int start;
            private int count;

            /// <summary>
            /// Create a sub-range view object on the indicate part 
            /// of the array.
            /// </summary>
            /// <param name="wrappedArray">Array to wrap.</param>
            /// <param name="start">The start index of the view in the wrapped list.</param>
            /// <param name="count">The number of items in the view.</param>
            public ArrayRange(T[] wrappedArray, int start, int count)
            {
                this.wrappedArray = wrappedArray;
                this.start = start;
                this.count = count;
            }

            public override int Count
            {
                get
                {
                    return count;
                }
            }

            public override void Clear()
            {
                Array.Copy(wrappedArray, start + count, wrappedArray, start, wrappedArray.Length - (start + count));
                Algorithms.FillRange(wrappedArray, wrappedArray.Length - count, count, default(T));
                count = 0;
            }

            public override void Insert(int index, T item)
            {
                if (index < 0 || index > count)
                    throw new ArgumentOutOfRangeException("index");

                int i = start + index;

                if (i + 1 < wrappedArray.Length)
                    Array.Copy(wrappedArray, i, wrappedArray, i + 1, wrappedArray.Length - i - 1);
                if (i < wrappedArray.Length)
                    wrappedArray[i] = item;

                if (start + count < wrappedArray.Length)
                    ++count;
            }

            public override void RemoveAt(int index)
            {
                if (index < 0 || index >= count)
                    throw new ArgumentOutOfRangeException("index");

                int i = start + index;

                if (i < wrappedArray.Length - 1)
                    Array.Copy(wrappedArray, i + 1, wrappedArray, i, wrappedArray.Length - i - 1);
                wrappedArray[wrappedArray.Length - 1] = default(T);

                --count;
            }

            public override T this[int index]
            {
                get
                {
                    if (index < 0 || index >= count)
                        throw new ArgumentOutOfRangeException("index");

                    return wrappedArray[start + index];
                }
                set
                {
                    if (index < 0 || index >= count)
                        throw new ArgumentOutOfRangeException("index");

                    wrappedArray[start + index] = value;
                }
            }
        }

        /// <summary>
        /// Returns a view onto a sub-range of an array. Items from <paramref name="array"/> are not copied; the
        /// returned IList&lt;T&gt; is simply a different view onto the same underlying items. Changes to <paramref name="array"/>
        /// are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the 
        /// view. After an insertion, the last item in <paramref name="array"/> "falls off the end". After a deletion, the
        /// last item in array becomes the default value (0 or null).
        /// </summary>
        /// <remarks>This method can be used to apply an algorithm to a portion of a array. For example:
        /// <code>Algorithms.ReverseInPlace(Algorithms.Range(array, 3, 6))</code>
        /// will reverse the 6 items beginning at index 3.</remarks>
        /// <param name="array">The array to view.</param>
        /// <param name="start">The starting index of the view.</param>
        /// <param name="count">The number of items in the view.</param>
        /// <returns>A list that is a view onto the given sub-array. </returns>
        /// <exception cref="ArgumentNullException"><paramref name="array"/> is null.</exception>
        /// <exception cref="ArgumentOutOfRangeException"><paramref name="start"/> or <paramref name="count"/> is negative.</exception>
        /// <exception cref="ArgumentOutOfRangeException"><paramref name="start"/> + <paramref name="count"/> is greater than the
        /// size of <paramref name="array"/>.</exception>
        public static IList<T> Range<T>(T[] array, int start, int count)
        {
            if (array == null)
                throw new ArgumentOutOfRangeException("array");
            if (start < 0 || start > array.Length || (start == array.Length && count != 0))
                throw new ArgumentOutOfRangeException("start");
            if (count < 0 || count > array.Length || count + start > array.Length)
                throw new ArgumentOutOfRangeException("count");

            return new ArrayRange<T>(array, start, count);
        }

        /// <summary>
        /// The read-only ICollection&lt;T&gt; implementation that is used by the ReadOnly method.
        /// Methods that modify the collection throw a NotSupportedException, methods that don't
        /// modify are fowarded through to the wrapped collection.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲午夜电影网| 亚洲chinese男男1069| 欧美mv和日韩mv国产网站| 91精品免费在线观看| 日韩午夜在线影院| 日韩一区在线播放| 亚洲综合一二区| 狠狠网亚洲精品| 91麻豆国产精品久久| 欧美日本国产视频| 久久嫩草精品久久久精品| 亚洲日本在线看| 国产一区二区影院| 欧美日本视频在线| 久久99精品久久久久久国产越南| 99久久99久久精品国产片果冻| 8x福利精品第一导航| 另类成人小视频在线| 91激情在线视频| 国产色91在线| 久久国产麻豆精品| 国产精品污网站| 蜜桃免费网站一区二区三区| 91社区在线播放| 99久久精品免费看| 亚洲在线一区二区三区| 精品国产伦理网| 久久 天天综合| 亚洲天堂免费在线观看视频| 欧美高清视频一二三区| 亚洲综合精品自拍| 欧美tk丨vk视频| 色综合欧美在线视频区| 中文字幕不卡在线观看| 国内精品自线一区二区三区视频| 亚洲同性同志一二三专区| 欧美一区二区三区四区高清| 丝袜美腿亚洲综合| 欧美剧在线免费观看网站| 国产精品亚洲一区二区三区妖精| 欧美成人欧美edvon| 色综合色综合色综合色综合色综合 | 亚洲免费色视频| a亚洲天堂av| 国产精品视频麻豆| 欧美一区日韩一区| 色妞www精品视频| 精品系列免费在线观看| 亚洲二区在线视频| 亚洲手机成人高清视频| 久久看人人爽人人| 日韩一级二级三级| 欧美婷婷六月丁香综合色| 亚洲国产wwwccc36天堂| 亚洲天堂av一区| 久久久精品国产99久久精品芒果| 欧美日韩高清一区二区| 色诱视频网站一区| www.av精品| 成人影视亚洲图片在线| 国产精品久久久久影院亚瑟| 91女厕偷拍女厕偷拍高清| 国产精品中文有码| 精久久久久久久久久久| 蜜桃视频一区二区三区在线观看| 亚洲国产精品综合小说图片区| 国产精品久久久久影院老司| 久久这里只有精品视频网| 成人av在线网站| 亚洲一区二区三区美女| 亚洲女同一区二区| 中文字幕中文字幕一区二区| 国产色综合一区| 国产欧美一区视频| 日本韩国视频一区二区| 91麻豆精品在线观看| www.成人网.com| 91论坛在线播放| 91久久精品一区二区三区| 在线视频中文字幕一区二区| 久久99精品国产麻豆不卡| 青青草成人在线观看| 国产精品麻豆久久久| 久久精品视频在线看| 久久久精品国产99久久精品芒果 | 久久久久久久电影| 国产人伦精品一区二区| 中文字幕免费在线观看视频一区| 国产日韩精品一区| 亚洲激情五月婷婷| 欧美激情一区二区在线| 国产精品久久久久影院老司| 亚洲三级在线免费观看| 亚洲一区二区三区四区五区黄| 亚洲va韩国va欧美va| 美女任你摸久久| 国产一二三精品| 91蜜桃视频在线| 欧美日韩国产综合一区二区| 日韩一区二区视频在线观看| 久久婷婷成人综合色| 国产精品久线观看视频| 亚洲综合一区在线| 精品夜夜嗨av一区二区三区| 国产成人三级在线观看| 久久av中文字幕片| 国产a级毛片一区| 国产一区视频网站| 99re66热这里只有精品3直播 | 久久品道一品道久久精品| 国产欧美视频在线观看| 亚洲一区二区视频在线观看| 麻豆91在线播放免费| 国产不卡视频一区二区三区| 欧美午夜精品电影| 久久美女艺术照精彩视频福利播放| 最新不卡av在线| 久久精品国产亚洲a| 99精品视频一区| 日韩欧美在线123| 中文字幕一区二区三| 日本亚洲免费观看| 五月天一区二区| 亚洲成年人网站在线观看| 国产在线视视频有精品| 欧美系列日韩一区| 国产蜜臀97一区二区三区| 香蕉久久夜色精品国产使用方法| 国内欧美视频一区二区| 欧美日韩视频在线一区二区| 欧美中文字幕一区二区三区| 久久综合色8888| 亚洲国产精品麻豆| k8久久久一区二区三区| 在线视频国内一区二区| 国产三级精品视频| 免费看日韩精品| 欧美自拍丝袜亚洲| 《视频一区视频二区| 极品美女销魂一区二区三区免费 | 成人免费黄色在线| 欧美大度的电影原声| 国产亚洲女人久久久久毛片| 亚洲精品乱码久久久久久久久| 国产在线精品免费av| 欧美裸体一区二区三区| 一区二区三区在线观看视频| 一区二区三区产品免费精品久久75| 国产一区二区三区在线观看免费| 欧美午夜一区二区三区免费大片| 中文一区二区在线观看| 精品一区二区三区在线播放视频| 欧美无人高清视频在线观看| 亚洲欧美日韩人成在线播放| 国产精品99久久久久久宅男| 日韩亚洲电影在线| 免费欧美在线视频| 欧美大片拔萝卜| 久久精品国产精品亚洲综合| 91麻豆精品国产91久久久 | 视频一区欧美精品| 欧美日韩综合色| 亚洲一卡二卡三卡四卡| 色婷婷综合视频在线观看| 亚洲少妇30p| 成人av小说网| 亚洲少妇最新在线视频| 色婷婷久久一区二区三区麻豆| 国产精品不卡视频| 91欧美一区二区| 亚洲一区二区欧美日韩 | 久久国产乱子精品免费女| 精品久久久三级丝袜| 精品综合免费视频观看| 精品国产免费一区二区三区四区| 精品一区二区三区免费观看| 精品动漫一区二区三区在线观看| 韩国精品主播一区二区在线观看| 精品99999| 成人高清视频免费观看| 亚洲精品国产精品乱码不99 | 亚洲色图.com| 欧美日韩在线直播| 免费成人在线观看视频| 久久久久久日产精品| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 寂寞少妇一区二区三区| 国产清纯美女被跳蛋高潮一区二区久久w | 欧美精品少妇一区二区三区| 蜜桃视频一区二区三区在线观看| 26uuu色噜噜精品一区二区| 粉嫩蜜臀av国产精品网站| 中文字幕在线不卡一区| 欧美日韩一区二区三区不卡| 日韩电影免费在线| 久久久久97国产精华液好用吗| 99久久久精品| 美女在线观看视频一区二区| 亚洲国产经典视频| 欧美视频三区在线播放|