You would have to either mutate the original vector or clone it, yes. If you really want to iterate through an immutable Vec with only constant memory usage, then you probably can’t get around O(n^2) runtime, but maybe there is some time-memory-tradeoff where a small memory usage can get some time reduction.
Same person as @Gobbel2000@feddit.de, different instance.
- 10 Posts
- 174 Comments
Maybe a heap data structure is what you’re looking for. Depending on the usecase you might have to first turn an unsorted Vec into a heap (runtime in O(n), which is still faster than fully sorting it), at that point you can both insert new elements and remove the minimum element within a time in O(log n).
Gobbel2000@programming.devto
Steam@programming.dev•Anyone who ordered Steam hardware in the last ~3 months in Europe just had their names, address, phone number and email stolen
2·1 month agoWell now I am glad I’m still stuck in the reservation queue.
Gobbel2000@programming.devto
memes@lemmy.world•Number on or number off which one do you prefer??
9·1 month agoNumber only, get out of here with superfluous symbols. I don’t need The Status Bar: Illustrated Edition.
Gobbel2000@programming.devto
Berlin@feddit.org•BVG kritisiert "FreiFahren"-App als unsolidarischDeutsch
9·1 month agoIch sehe das als Folge der verfehlten Verkehrspolitik in Berlin und als berechtigten Protest dagegen. Schwarzfahren fällt unverständlicherweise immer noch unter das Strafrecht und außerdem sind die Ticketpreise mittlerweile wirklich sehr hoch.
Würde die Verkehrspolitik einen ÖPNV im Interesse der Bürger priorisieren und mit akzeptablen Preisen attraktiver machen, dann wäre so eine Aktion gar nicht nötig.
Gobbel2000@programming.devto
Privacy@programming.dev•Mullvad on the Donation Controversy
51·2 months agoI don’t disagree with the position of the company as outlined in this statement and their neutral position. But by being a customer of the company I would also be paying the co-founder with his weird views that are definitely not neutral, and that is still worth avoiding. And maybe his individual opinions are actually more representative of the companies values because they aren’t filtered through a PR team. As long as they are not the only good VPN provider, I don’t want to support this.
Gobbel2000@programming.devto
Android@lemmy.world•There's one group of Android users Google's new sideloading rules won't affectEnglish
7·2 months agoI’m very happy with the compromise offered by LineageOS between a Googled phone and a free OS. LineageOS support was a hard requirement for me while choosing my current phone.
Gobbel2000@programming.devto
Today I Learned@lemmy.world•TIL the country code for Switzerland is CH and is derived from Latin name for Switzerland, Confoederatio HelveticaEnglish
14·2 months agoThe reason is to avoid favoring any one of the four official languages by deriving the code from a neutral, fifth language.
Gobbel2000@programming.devto
Fuck Cars@lemmy.world•America vs Europe: Two Ways to Build a CityEnglish
151·3 months agoNot here to defend North American urban planning, but these diagrams make absolutely no sense. Also, both Europe and the Americas are highly diverse and cannot be generalized so easily.
Gobbel2000@programming.devto
Linux Gaming@lemmy.world•The Real Reason Nvidia Has Abandoned PC GamersEnglish
11·3 months agoI have no doubt that the companies will keep high margins and incentivize people to keep spending, but the customers have a choice when to upgrade their hardware and I believe based on these developments that they will choose to upgrade less frequently than they used to.
Gobbel2000@programming.devto
Linux Gaming@lemmy.world•The Real Reason Nvidia Has Abandoned PC GamersEnglish
16·3 months agoI was momentarily confused that this article is pretty much the script of a YT video by Hardware Unboxed I saw recently, but then I noticed that he is literally the author.
While all these developments point in a very worrying direction, I think there are some positives to this: Fewer performance gains means longer upgrade cycles, longer support windows and less pressure on consumers to keep soending money on upgrades (although the eventual upgrade is now way more expensive).
К сожалению не получаешь люди хорошо говорящие по русским.
Gobbel2000@programming.devto
Rust@programming.dev•Error Handling in Rust vs. Exceptions in other languages
2·3 months agoThere is the
map_errmethod on Result which simplifies this case. But yes, anyhow is still easier if you don’t care that much about the error contents.
4 bytes not 4 bits, so 32 bits. You can’t do graphics on 4 bits, that’s way too small.
Gobbel2000@programming.devtoMicroblog Memes@lemmy.world•Publisher CEO for Subnautica asked ChatGPT how to avoid paying out bonusesEnglish
29·4 months agoHe always had a full legal team at his disposal. But he not only didn’t consult them, he completely ignored their warnings, fully trusting the sycophancy machine.
Gobbel2000@programming.devto
Showerthoughts@lemmy.world•Why does songs from non-English countries have random English words? Can you imagine if English songs randomly have Chinese words?
0·4 months agoPlease show me songs about eigenvalues.
Da das wirklich alle zahlen müssen, sehe ich das eher so, dass diejenigen, die ihren Auswies verplempern draufzahlen müssen.
Gobbel2000@programming.devto
Privacy@programming.dev•Leaked list shows Facebook training their AI on multiple Lemmy instances
1·1 year agoreddit.comis in fact not on the list.



















I can tell that you didn’t read the article aside from the bullet points, because the point of the article is to refute these ideas presented at the beginning. It is about how tools are often culturally enshrined, how they directly affect people while also being designed by us. I encourage you to read it in full.