Suppose you being a network programmer are given a task to receive audio and video packets (VoIP data) from a network and store them in your computer, so that a video or audio player can play them in order. Packets that are too slow are discarded. Here note that Voice signals are sequential by nature i.e., they must be played back in the order in which they were sent. Suppose you have a limited memory and these packets are heavy and needs lots of memory to store them. You have been asked to efficiently utilize the available memory. Now consider following two cases:
1. Data transferring speed is faster than data playing. When very few packets have been played and new packets have also been received.
2. Data transferring speed is slower than data playing. On average, when half of packets have been played before receiving new packets.
Question is
Which data structure would you use for above scenario? Justify your answer with solid points.