4 ms·
But Set can just overwrites the specified element while Insert will insert the element at the specified position by pushing the element and all following elemen
by danbruc 12y ago
But Set can just overwrites the specified element while Insert will insert the element at the specified position by pushing the element and all following elements out of the way.
- SideburnsOfDoom 12y ago> But Set can just overwrites the specified element Kind of: Set returns a new Vector with a changed state (the specified element overwritten). But yes, this implement is very sparse: there's no way to add and remove elements in the middle, no way to even tell how many elements are in the list: https://news.ycombinator.com/item?id=8592178 https://news.ycombinator.com/item?id=8592178 Perhaps omitting them hides some different optimisation choices (i.e. they would be more expensive) Maybe it's just a proof of concept?