using System; using System.Collections.Generic; using System.Text; using System.Collections; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { Queue qu = new Queue(); Queue qu2 = new Queue(); ] { , , , }) { qu.Enqueue(…
Stack集合(先进后出) Stack ss = new Stack();//初始化 ss.Push(1);//.Push()一个一个推进,赋值ss.Push(2);ss.Push(3);ss.Push(4); Console.WriteLine(ss.Count);//统计元素个数 Console.WriteLine(ss.Pop());//弹出 Console.WriteLine(ss.Peek());//单纯查看,不弹出 foreach(int aa in ss){Console.Writ…
一) ArrayList 1.foreach遍历数组中各个元素,执行内部语句 2. 3. 4. myarry.Clear();//将集合清空 bool b = myarry.Contains(3);//判断是否有括号内的数据,返回的是bool值(True或者False) int bb = myarry.IndexOf(2);int cc = myarry.LastIndexOf(2);Console.WriteLine(bb); ArrayList ar = new ArrayList()…