Beispiel #1
0
        static void Main(string[] args)
        {
            var reversedList = new ReversedList <int>();

            reversedList.Add(1);
            reversedList.Add(2);
            reversedList.Add(3);
            reversedList.Add(4);

            Console.WriteLine(reversedList.RemoveAt(3));
            Console.WriteLine(reversedList.RemoveAt(0));

            Console.WriteLine(reversedList.Count);
            Console.WriteLine(reversedList.Capacity);
        }
Beispiel #2
0
        public static void Main()
        {
            var list = new ReversedList<int>();

            Console.WriteLine(list.Capacity);

            for (int i = 1; i < 10; i++)
            {
                list.Add(i);
            }

            Console.WriteLine(string.Join(" ", list));
            Console.WriteLine(list[1]);
            Console.WriteLine(list.RemoveAt(1));
            Console.WriteLine(string.Join(" ", list));
            list.Add(1);
            Console.WriteLine(string.Join(" ", list));
        }