2 ms·
Sorry, but the only ignorance here is your own. You assumed that "storing into an array" means that the array index is the only thing relevant for locating a re
by hyc_symas 12y ago
Sorry, but the only ignorance here is your own. You assumed that "storing into an array" means that the array index is the only thing relevant for locating a record. But the fact that you're talking about inserts/deletes means that the array index of a particular element is mutable and therefore insufficient for uniquely locating a record. Which means you must perform some type of search to retrieve a particular item. Your O(1) getitem is nonsense.
Yes, you can say "give me the 5th element of this array" but the discussion was about maps/dictionaries, where you're more often going to say "give me item foo that was inserted before".
When folks like you post while obviously not paying attention, yes, you elicit a dismissive response.