示例#1
0
        static void Main(string[] args)
        {
            Deque deque = new DLinkDeque();

            var lines = File.ReadAllLines("integers.txt");

            foreach (var line in lines)
            {
                deque.Push(Convert.ToInt32(line));
            }

            foreach (var item in deque)
            {
                Console.WriteLine(item);
            }
        }
示例#2
0
        static void Main(string[] args)
        {
            Deque <int>    intDeque    = new DLinkDeque <int>();
            Deque <string> stringDeque = new DLinkDeque <string>();

            intDeque.Push(1);
            intDeque.Push(2);
            intDeque.Push(3);

            stringDeque.Push("Hello");
            stringDeque.Push("World");

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

            foreach (var item in stringDeque)
            {
                Console.WriteLine(item);
            }
        }
示例#3
0
 public DLinkDequeEnumerator(DLinkDeque <T> deque)
 {
     this.deque       = deque;
     this.currentNode = null;
 }