Python Deque

preview_player
Показать описание
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()
------------------------------------------------------------------------------------------------------------------------

Creator: Arash Rowshan

#Python #DataStructures
Рекомендации по теме