コード例 #1
0
ファイル: Program.cs プロジェクト: mdtimshin/ex.9
        public void Remove(ref LinearList <double> posl, int index)
        {
            for (int i = index; i < count; i++)
            {
                posl[i].number = posl[i].number - 1;
            }
            LinearList <double> copy = new LinearList <double>(count);

            copy = (LinearList <double>)posl.MemberwiseClone();
            posl = new LinearList <double>(count - 1);
            int COUNT = 0;

            for (int i = 0; i < count; i++)
            {
                if (i != index - 1)
                {
                    posl[COUNT] = copy[i];
                    COUNT++;
                }
            }
            count--;
        }