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
On this page of the site you can watch the video online Python Deque with a duration of hours minute second in good quality, which was uploaded by the user ARASHOO 25 January 2021, share the link with friends and acquaintances, this video has already been watched 416 times on youtube and it was liked by 15 viewers. Enjoy your viewing!