Example #1
0
        static void Main(string[] args)
        {
            var array = new DynamicArray <string>();

            array.Add("Georgi");
            array.Add("Nikolai");
            Console.WriteLine(array.IndexOf("Nikolai"));
            Console.WriteLine(array.Cointains("Kiril"));
            array.Remove("Georgi");
            array.InsertAt(1, "Ivan");
            array.Clear();
            Console.WriteLine(array.Capacity);
            Console.WriteLine(array.Count);

            array.Add("Stefan");
            array.Add("Krum");
            var arr = array.ToArray();

            Console.WriteLine();
            foreach (var item in array)
            {
                Console.WriteLine(item);
            }
            Console.WriteLine();

            foreach (var item in arr)
            {
                Console.WriteLine(item);
            }
        }
Example #2
0
        //Pop
        public T Pop()
        {
            T value = dynamicStack.Get(dynamicStack.logicalSize - 1);

            dynamicStack.Remove(dynamicStack.logicalSize - 1);
            return(value);
        }
Example #3
0
        //Dequeue
        public T Dequeue()
        {
            T value = dynamicQueue.Get(head);

            dynamicQueue.Remove(head);
            return(value);
        }