in reply to Re^3: Hashes do preserve insertion order after all
in thread Hashes do preserve insertion order after all
memory and time: What I had in mind was the solution of an array in tandem with a hashtable. The array receives items as they are created, and so it keeps the order of insertion. And the hashtable stores data with key to facilitate search-by-key. However deleting by key is not efficient as it needs to search the array too. Introducing more values to the hash (e.g. the corresponding array index) increases memory. Inserting also needs updating 2 data structures.
10 min edit: also deleting from middle of array is inefficient.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Hashes do preserve insertion order after all
by swl (Prior) on Aug 01, 2019 at 08:06 UTC | |
by LanX (Saint) on Aug 01, 2019 at 11:11 UTC | |
by swl (Prior) on Aug 02, 2019 at 00:19 UTC | |
|
Re^5: Hashes do preserve insertion order after all
by LanX (Saint) on Aug 01, 2019 at 02:37 UTC |