Python Deque
📙 Table of Contents 📙
=============================================
00:00 - What's a Deque
00:17 - Initialization
00:53 - Deque Methods: Append, Pop, Extend (Left)
02:01 - FIFO Queue
03:57 - Deque Methods: Index, Count, Insert, Remove
04:29 - Deque Methods: Reverse, Rotate
05:46 - Maximum Length
06:45 - Time Complexity
🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁
-------------------------------------------------------------------------------------------------------------------------
Question:
Design a data structure for an ice cream shop to show people in line at any given time. Your data structure should satisfy the following interfaces:
class IceCreamShop:
add_person_to_line(name): return None
serve_ice_cream(): return name (or None if no one in line)
get_people_in_line(): return list of names
Your data structure will be called as such:
shop = IceCreamShop()
shop.add_person_to_line('John')
shop.add_person_to_line('Jill')
shop.serve_ice_cream()
shop.add_person_to_line('Kim')
shop.get_people_in_line()
------------------------------------------------------------------------------------------------------------------------
Creator: Arash Rowshan
📱Twitter: / oso_arash
📷Instagram: / arash_rowshan
#Python #DataStructures
Nesta página do site você pode assistir ao vídeo on-line Python Deque duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário ARASHOO 25 Janeiro 2021, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 416 vezes e gostou 15 espectadores. Boa visualização!