
July 31, 2020
7:59 p.m.
On Sat, Aug 1, 2020 at 9:55 AM Marco Sulla <Marco.Sulla.Python@gmail.com> wrote:
On Sat, 1 Aug 2020 at 02:30, Stestagg <stestagg@gmail.com> wrote:
The dict keys is compact only *until* you delete an item, at which point, a hole is left in the array
No, the array of items has no hole. The hole is inserted in the hashtable.
Yes, the array of items has hole. Otherwise, `del d[k]` become `O(n)`, or `del d[k]` won't preserve insertion order. Please teach me if you know any algorithm which has no hole, O(1) deletion, preserving insertion order, and efficient and fast as array. -- Inada Naoki <songofacandy@gmail.com>