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

后端 未结 3 1967
借酒劲吻你
借酒劲吻你 2020-12-10 10:13

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

相关标签:
3条回答
  • 2020-12-10 10:38

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

    0 讨论(0)
  • 2020-12-10 10:48

    Are you looking for the Queue<T> class?

    0 讨论(0)
  • 2020-12-10 10:58

    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

    0 讨论(0)
提交回复
热议问题