Created
February 24, 2015 20:43
-
-
Save calebmadrigal/dbcab5928f687668cb32 to your computer and use it in GitHub Desktop.
FIFO, LIFO, YOLO
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
from collections import deque | |
print("#FIFO") | |
queue = deque() | |
for i in range(10): | |
queue.append(i) | |
print([queue.popleft() for _ in range(len(queue))]) | |
print("#LIFO") | |
stack = [] | |
for i in range(10): | |
stack.append(i) | |
print([stack.pop() for _ in range(len(stack))]) | |
print("#YOLO") | |
yolo = list(range(10)) | |
random.shuffle(yolo) | |
print(yolo) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
HAHUHAHEHIHAHUHEHA!