stuff
This commit is contained in:
29
5-queue/README.md
Normal file
29
5-queue/README.md
Normal file
@ -0,0 +1,29 @@
|
||||
## Queue
|
||||
|
||||
Wikipedia on [queues](http://en.wikipedia.org/wiki/Queue_(abstract_data_type)).
|
||||
|
||||
The opposite of the Stack, the Queue is a FIFO data structure - First In, First Out.
|
||||
|
||||
#### Visualization
|
||||
|
||||
A music playlist works like a queue.
|
||||
|
||||
|Tommy Tutone - 8675309 Jenny|
|
||||
|
|
||||
|Europe - The Final Countdown|
|
||||
|
|
||||
|Dio - Holy Diver|
|
||||
|
||||
The enqueue operation will add a song to the end. The dequeue operation will pop off the front.
|
||||
|
||||
#### Implementation
|
||||
|
||||
You will need to create a Queue class that holds the following methods:
|
||||
|
||||
- enqueue
|
||||
|
||||
- dequeue
|
||||
|
||||
- is_empty
|
||||
|
||||
- get_front.
|
3
5-queue/queue.py
Normal file
3
5-queue/queue.py
Normal file
@ -0,0 +1,3 @@
|
||||
class Queue:
|
||||
def __init__():
|
||||
pass
|
Reference in New Issue
Block a user