[Tutor] data structures general query
William Ray Wing
wrw at mac.com
Wed Jun 26 13:59:10 EDT 2019
> On Jun 26, 2019, at 6:40 AM, mhysnm1964 at gmail.com wrote:
>
> All,
>
>
>
> General computer science question for data structures.
>
> When would you use the below structures and why? If you can provide a real
> life example on when they would be used in a program This would be great. I
> am not after code, just explanation.
>
One of the most useful (to me) structures is the double-ended queue ("from collections import deque”). It creates a queue that can quickly remove an item from one end and add an item to the other. Particularly useful for displaying a sliding window into time series data, or a moving track of the most recent n observations of a physical measurement.
Bill
More information about the Tutor
mailing list