添加Lesson11
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
using System.Collections.Generic;
|
||||
namespace Lesson11_泛型栈和队列练习
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
#region
|
||||
//总结一下
|
||||
//数组,List,Dictionary,Stack,Queue,LinkedList
|
||||
//这些存储容器对我们来说应该如何使用
|
||||
|
||||
//普通线性表:
|
||||
//数组,List,LinkedList
|
||||
//数组:定长,查询快,增删慢
|
||||
//List:经常增删,通过下标查询
|
||||
//LinkedList:不定长的,经常增删,查找不多
|
||||
|
||||
//先进后出:
|
||||
//stack
|
||||
//对于一些可以利用先进后出逻辑的场景,可以使用stack
|
||||
//例如游戏UI的打开和关闭
|
||||
|
||||
//先进先出:
|
||||
//queue
|
||||
//对于一些可以利用先进先出逻辑的场景,可以使用queue
|
||||
//例如游戏中的子弹池,子弹的发射和回收
|
||||
//消息队列
|
||||
|
||||
//键值对:
|
||||
//Dictionary
|
||||
//需要频繁通过键来查找值的场景,可以使用Dictionary
|
||||
//比如ID对应的数据内容
|
||||
//道具ID对应道具信息
|
||||
//怪物ID对应怪物对象
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user