How to work with “FIFO” in C# .NET?

♀尐吖头ヾ 提交于 2019-11-27 06:33:46

问题


Is there a standard collection in .NET that implements a FIFO stack?


回答1:


FIFO means first-in-first-out. The data structure you're looking for is called a Queue.




回答2:


FIFO means first in first out. This is as opposed to LIFO (or FILO as lucero pointed out). which is last in first out.

A link comparing queues, stacks, and hashtables.

You want to use a queue object for FIFO operations:

http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=66

MSDN link on queues

And a stack is used for LIFO operations: Stack Link




回答3:


Are you looking for the Queue<T> class?



来源:https://stackoverflow.com/questions/2966286/how-to-work-with-fifo-in-c-sharp-net

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!