Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- namespace Quee_Stack_Hashset_Dictionary
- {
- class Program
- {
- static void Main(string[] args)
- {
- //Queue FIFO
- Queue<string> coda = new Queue<string>();
- coda.Enqueue("Primo arrivato allo sportello");
- coda.Enqueue("Secondo arrivato allo sportello");
- coda.Enqueue("Terzo arrivato allo sportello");
- //foreach (string s in coda)
- // Console.WriteLine(s);
- //while (coda.TryDequeue( out string s))
- // Console.WriteLine(s);
- //while (coda.Count > 0)
- // Console.WriteLine(coda.Dequeue());
- Stack<string> pila = new Stack<string>();
- pila.Push("Primo piatto");
- pila.Push("Secondo piatto");
- pila.Push("Terzo piatto");
- foreach (string s in pila)
- Console.WriteLine(s);
- while (pila.Count > 0)
- Console.WriteLine(pila.Pop());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement