Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: UTF-8 -*-
- __author__ = 'Julio Tentor <jtentor@fi.unju.edu.ar>'
- from SpecialQueue import SpecialQueue
- import random
- print("Demo Queue - versión genérica - Caso Ejemplo b)")
- queue1 = SpecialQueue()
- number = 0
- print("Enqueuing...")
- for c in range(10):
- number = random.randrange(11)
- queue1.append(number)
- print(number, end=" ")
- print()
- print("Joining with same queue...")
- queue2 = queue1.join(queue1)
- print("Dequeuing...")
- while(len(queue1) > 0):
- print(queue1.popleft(), end=" ")
- print()
- print("Dequeuing joined queue...")
- while(len(queue2) > 0):
- print(queue2.popleft(), end=" ")
- print()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement