A queue is a common data structure that is often used in computer science.
- In your own words (300-500 words will suffice), explain–in your own words–what a queue is, what its uses are, common properties of queues.
- Implement a queue in your language of choice. It should have the following methods:
- enqueue: place an item into the queue, return the queue
- dequeue: take the appropriate item off of the queue, return the queue
- peek: return the first item from the queue, but do not remove it
- size: the number of items in the queue
- Discuss any potential trade-offs of your approach, including performance, memory allocation, or related concerns. Discuss any related methods that would be useful.
Approach this problem as though you were designing this as a third-party library that would be included in other programs.
The final format should be a README.md
file containing the answers to questions 1 and 3, as well any related files and/or directories necessary for implementation.
Please note that if you choose a language that already contains a queue or a queue-like data structure, there is a strong preference that you would implement a queue from scratch.