How would I implement a QueueDictionary, a combination of Queue and Dictionary in C#?

前端 未结 3 803
无人及你
无人及你 2021-01-18 15:00

Basically the data structure I want would mirror a MSMQ but would be in memory, because it is being used in the one process. By mirroring MSMQ I mean you would enqueue objec

3条回答
  •  甜味超标
    2021-01-18 15:40

    What if you used a double-linked list to act as the Queue and that way you can have full control of the Enqueue, Dequeue, and specially the Get method. So in the Get method you can simply remove the key from the double-linked list.

提交回复
热议问题