Python Deque

Pubblicato il: 25 gennaio 2021
sul canale di: ARASHOO
416
15

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


In questa pagina del sito puoi guardare il video online Python Deque della durata di ore minuti seconda in buona qualità , che l'utente ha caricato ARASHOO 25 gennaio 2021, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 416 volte e gli è piaciuto 15 spettatori. Buona visione!