static void Main(string[] args) { //Stack Operations Stack stack = new Stack(); stack.Push(70); stack.Push(30); stack.Push(56); stack.Display(); stack.Peek(); stack.Pop(); stack.IsEmpty(); stack.Display(); //Queue Operations Queue linkedListQueue = new Queue(); linkedListQueue.Enqueue(56); linkedListQueue.Enqueue(30); linkedListQueue.Enqueue(70); linkedListQueue.Dequeue(); linkedListQueue.Display(); }
static void Main(string[] args) { Stack stack = new Stack(); stack.Push(70); stack.Push(30); stack.Push(56); stack.Display(); stack.IsEmpty(); stack.Enqueue(56); stack.Enqueue(30); stack.Enqueue(70); stack.Dequeue(); stack.DisplayQueue(); }
static void Main(string[] args) { //Stack Operations Stack <float> stack = new Stack <float>(); stack.Push(1.2f); stack.Push(32f); stack.Push(44.3f); stack.Display(); //Queue Operations Queue <string> queue = new Queue <string>(); queue.Enqueue("Hello"); queue.Enqueue("There"); queue.Enqueue("How"); queue.Display(); }