c# Adding a Remove(int index) method to the .NET Queue class

前端 未结 12 1539
攒了一身酷
攒了一身酷 2021-01-07 17:14

I would like to use the generic queue class as described in the .NET framework (3.5) but I will need a Remove(int index) method to remove items from the queue. Can I achieve

12条回答
  •  星月不相逢
    2021-01-07 17:45

    What you want is a List where you always call RemoveAt(0) when you want to get the item from the Queue. Everything else is the same, really (calling Add would add an item to the end of the Queue).

提交回复
热议问题