Files
2025-10-15 10:11:45 +08:00

40 lines
1.3 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System.Collections.Generic;
namespace Lesson11_泛型栈和队列练习
{
internal class Program
{
static void Main(string[] args)
{
#region
//总结一下
//数组,ListDictionaryStackQueueLinkedList
//这些存储容器对我们来说应该如何使用
//普通线性表:
//数组,ListLinkedList
//数组:定长,查询快,增删慢
//List:经常增删,通过下标查询
//LinkedList:不定长的,经常增删,查找不多
//先进后出:
//stack
//对于一些可以利用先进后出逻辑的场景,可以使用stack
//例如游戏UI的打开和关闭
//先进先出:
//queue
//对于一些可以利用先进先出逻辑的场景,可以使用queue
//例如游戏中的子弹池,子弹的发射和回收
//消息队列
//键值对:
//Dictionary
//需要频繁通过键来查找值的场景,可以使用Dictionary
//比如ID对应的数据内容
//道具ID对应道具信息
//怪物ID对应怪物对象
#endregion
}
}
}