2013年12月5日

字典Dictionary

摘要: /*字典Dictionary (映射或者散列表)键值对的,如果把一个自定义类型作为字典的键,那么必须重写GetHashCode和Equals方法string类就实现了,一般用string类型的最为键*/using System.Collections.Generic;namespace Frank{ public class Test { //程序入口 public static void Main(string[] args) { Dictionary d = new Dictionary(); d.Add("1","a"); d.Add(" 阅读全文

posted @ 2013-12-05 14:58 wp456 阅读(129) 评论(0) 推荐(0)

有序列表

摘要: /*有序列表键值对的表示一个键只能有一个值,如果需要多个值,使用Lookup类*/using System.Collections.Generic;namespace Frank{ public class Test { //程序入口 public static void Main(string[] args) { SortedList books = new SortedList(); books.Add("1","2sad"); books.Add("2","sadsad"); books["3&qu 阅读全文

posted @ 2013-12-05 11:49 wp456 阅读(144) 评论(0) 推荐(0)

双向链表

摘要: /*双向链表放入元素速度十分的快。*/using System.Collections.Generic;namespace Frank{ public class Test { //程序入口 public static void Main(string[] args) { LinkedListNode ln = new LinkedListNode("c"); LinkedList ll = new LinkedList(); ll.AddLast("a"); ll.AddLast("b"); ll.AddLast(ln); for. 阅读全文

posted @ 2013-12-05 11:38 wp456 阅读(101) 评论(0) 推荐(0)

栈,后进先出

摘要: /*栈,后进先出*/using System.Collections.Generic;namespace Frank{ public class Test { //程序入口 public static void Main(string[] args) { Stack stack = new Stack(); stack.Push(1); stack.Push(5); stack.Push(6); stack.Push(7); foreach (int item in stack) { System.Console.Write... 阅读全文

posted @ 2013-12-05 10:42 wp456 阅读(320) 评论(0) 推荐(0)

队列的使用 先进先出的原则

摘要: /*队列的使用 先进先出的原则*/using System.Threading;using System.Collections.Generic;namespace Frank{ public class Test { //程序入口 public static void Main(string[] args) { DocumentManager dm = new DocumentManager(); ProcessDocuments.Start(dm); for(int i = 0;i documentQueue = new Queue(); ... 阅读全文

posted @ 2013-12-05 10:30 wp456 阅读(541) 评论(0) 推荐(0)

导航