亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
视频一区在线播放| 精品无人区卡一卡二卡三乱码免费卡| 日韩一区二区在线播放| 高清不卡在线观看av| 天天影视色香欲综合网老头| 国产欧美日本一区二区三区| 欧美日本国产视频| 99精品一区二区| 韩国女主播一区| 亚洲成人久久影院| ...xxx性欧美| 国产日韩欧美激情| 日韩久久精品一区| 51午夜精品国产| 91福利资源站| 91论坛在线播放| 成人永久aaa| 国产精品18久久久久久vr| 日韩成人午夜精品| 亚洲va欧美va人人爽午夜| 亚洲欧美在线aaa| 日本一区二区不卡视频| 精品成人一区二区三区四区| 欧美精品乱码久久久久久按摩| 91视频在线看| 93久久精品日日躁夜夜躁欧美| 国产伦精一区二区三区| 激情小说欧美图片| 免费三级欧美电影| 免费在线观看视频一区| 蜜臀精品一区二区三区在线观看 | 亚洲成人黄色小说| 自拍偷拍亚洲欧美日韩| 国产精品久久777777| 国产欧美一区二区精品性色超碰 | 91精品国产综合久久久久久久久久| 99热国产精品| 97精品超碰一区二区三区| 92精品国产成人观看免费| 99久久精品国产观看| 成人av网站在线观看| 丁香啪啪综合成人亚洲小说 | 欧美在线三级电影| 欧美综合一区二区三区| 色婷婷激情一区二区三区| 一本大道久久a久久综合| 91蝌蚪国产九色| 在线免费不卡视频| 欧美日韩国产高清一区二区三区 | 亚洲日本丝袜连裤袜办公室| 亚洲欧美日韩国产另类专区| 一区二区三区小说| 亚洲成人一区在线| 日韩av一级片| 国产一区二区三区四区五区入口 | 欧美日本视频在线| 日韩一级成人av| 国产日韩欧美一区二区三区乱码| 中文字幕国产精品一区二区| 国产精品成人午夜| 亚洲va中文字幕| 极品少妇xxxx精品少妇偷拍| 成人午夜激情视频| 欧美影院精品一区| 日韩欧美一区二区免费| 国产三级精品三级| 亚洲一区成人在线| 精品中文字幕一区二区| fc2成人免费人成在线观看播放| 91丨porny丨首页| 欧美日韩国产天堂| 国产欧美一区二区三区鸳鸯浴| 亚洲人成网站在线| 秋霞午夜av一区二区三区 | 精品视频123区在线观看| 欧美一区2区视频在线观看| 久久久精品天堂| 亚洲电影视频在线| 国产精品亚洲视频| 在线亚洲一区观看| 2017欧美狠狠色| 亚洲一区成人在线| 国产精品中文字幕日韩精品| 色妹子一区二区| 欧美不卡视频一区| 一区二区三区中文免费| 久久成人免费电影| 欧美性受xxxx黑人xyx性爽| xnxx国产精品| 亚洲高清免费一级二级三级| 国内精品在线播放| 欧美午夜影院一区| 国产精品国产三级国产aⅴ入口| 午夜精彩视频在线观看不卡| 国产成人8x视频一区二区| 欧美日韩在线综合| 中文成人综合网| 免费在线观看一区二区三区| 91亚洲精品一区二区乱码| 欧美大片在线观看一区二区| 一区二区三区中文字幕电影| 国产美女一区二区| 日韩西西人体444www| 一区二区三区欧美| 成人av综合在线| 久久综合国产精品| 秋霞国产午夜精品免费视频| 欧美在线观看一二区| 中文字幕二三区不卡| 另类专区欧美蜜桃臀第一页| 欧洲中文字幕精品| 亚洲欧美中日韩| 成人午夜电影久久影院| 精品成人私密视频| 极品美女销魂一区二区三区免费| 欧美日韩在线三级| 亚洲国产视频直播| 色综合色狠狠综合色| 中文字幕高清一区| 国产成人av电影免费在线观看| 精品剧情在线观看| 老司机精品视频一区二区三区| 欧美乱妇23p| 五月天亚洲婷婷| 7777精品伊人久久久大香线蕉最新版 | 午夜精品一区二区三区三上悠亚| 成人性视频免费网站| 久久日韩粉嫩一区二区三区 | 国产成人在线观看免费网站| 欧美www视频| 久久精品国产**网站演员| 91精品视频网| 男人操女人的视频在线观看欧美| 69久久夜色精品国产69蝌蚪网| 亚洲大片一区二区三区| 在线观看一区二区视频| 亚洲国产中文字幕| 欧美日韩久久久| 香蕉久久一区二区不卡无毒影院| 在线一区二区三区做爰视频网站| 一区二区免费在线播放| 欧美日韩1234| 免费观看91视频大全| 精品国产一区二区三区四区四 | 日本aⅴ亚洲精品中文乱码| 91精品国产综合久久蜜臀| 日本v片在线高清不卡在线观看| 日韩一区二区高清| 狠狠色综合日日| 欧美激情一区二区三区| 成人免费视频一区二区| 国产精品初高中害羞小美女文| 色综合天天综合网天天看片| 亚洲制服丝袜av| 91精品国产综合久久精品app| 日本中文在线一区| 久久精品日产第一区二区三区高清版| 国产91在线观看| 亚洲裸体xxx| 3d动漫精品啪啪| 丁香桃色午夜亚洲一区二区三区| 亚洲欧美日韩系列| 91精品国产色综合久久久蜜香臀| 精品影视av免费| 国产精品欧美极品| 欧日韩精品视频| 国产精品主播直播| 亚洲永久精品国产| 精品久久久久一区| 91香蕉视频污在线| 日本不卡123| 成人欧美一区二区三区视频网页| 欧美色视频一区| 国产精品88888| 亚洲成av人在线观看| 国产欧美综合在线| 欧美日韩激情一区| 岛国精品在线观看| 日韩av一级电影| 亚洲人一二三区| 日韩欧美中文字幕公布| 波波电影院一区二区三区| 日韩精品成人一区二区在线| 国产网红主播福利一区二区| 在线观看精品一区| 国产精品一区二区三区四区| 亚洲综合免费观看高清完整版在线| 精品对白一区国产伦| 欧美日韩一区二区在线观看| 国产在线不卡一区| 午夜一区二区三区在线观看| 国产精品三级视频| 日韩欧美中文字幕制服| 91蜜桃免费观看视频| 激情欧美一区二区三区在线观看| 亚洲精品欧美综合四区| 久久久久久久久伊人| 3d成人h动漫网站入口| 91论坛在线播放| 国产999精品久久久久久绿帽|