Dict là hash table. Lookup key gần như constant time (amortized O(1)), bất kể size. Tạo hash của key, tìm vị trí bucket. Nếu collision → chạy collision resolution algorithm.
Trade-off: dict tốn nhiều memory hơn do sparse structure.
Dict là hash table. Lookup key gần như constant time (amortized O(1)), bất kể size. Tạo hash của key, tìm vị trí bucket. Nếu collision → chạy collision resolution algorithm.
Trade-off: dict tốn nhiều memory hơn do sparse structure.