Beispiel #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            LinkedListStack linkedListStack = new LinkedListStack();

            linkedListStack.Push(70);
            linkedListStack.Push(30);
            linkedListStack.Push(56);
            linkedListStack.Display();
            linkedListStack.Peek();
            linkedListStack.Pop();
            linkedListStack.IsEmpty();
            linkedListStack.Display();

            LinkedListQueue linkedListQueue = new LinkedListQueue();

            linkedListQueue.Enqueue(56);
            linkedListQueue.Enqueue(30);
            linkedListQueue.Enqueue(70);
            linkedListQueue.Display();
            linkedListQueue.Dequeue();
            linkedListQueue.Display();
            linkedListQueue.Dequeue();
            linkedListQueue.Display();
            Console.ReadKey();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            LinkedListStack stack = new LinkedListStack();

            stack.Push(10);
            stack.Push(20);
            stack.Push(45);
            stack.Push(67);
            stack.PeekAndPopUntilStackIsEmpty();
            LinkedListQueue queue = new LinkedListQueue();

            queue.Enqueue(20);
            queue.Enqueue(55);
            queue.Enqueue(76);
            queue.Dequeue();
        }