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.
- 3 Posts
- 68 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
memes@lemmy.world•Number on or number off which one do you prefer??
9·25 days agoNumber only, get out of here with superfluous symbols. I don’t need The Status Bar: Illustrated Edition.
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
15·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
Linux Gaming@lemmy.world•The Real Reason Nvidia Has Abandoned PC GamersEnglish
11·2 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·2 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
3·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.
Gobbel2000@programming.devtoMicroblog Memes@lemmy.world•Publisher CEO for Subnautica asked ChatGPT how to avoid paying out bonusesEnglish
31·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
PC Master Race@lemmy.world•Steam's database suggests Valve already has a reservation queue system ready for the Steam MachineEnglish
13·4 months agoI think the news here is not that a reservation system will be used. That much is obvious after introducing it for the controller. The more interesting part here is that Valve is actively preparing the launch for the Steam machines and frames right now.
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?
10·4 months agoPlease show me songs about eigenvalues.
Gobbel2000@programming.devto
Shitty Life Pro Tip@lemmy.world•Hotel has extra fees? Well then...
283·4 months agoIt’s time to stop subsidizing parking spaces. Their land use is actually really expensive and that burden should be on those using the land for storing tons of metal, not cross-financed by those choosing more sustainable means of transport.
Gobbel2000@programming.devto
Mildly Interesting@lemmy.world•different kinds of cheesecakes
7·5 months agoHigh fat content I believe, as in rich in fat.
I get the idea, but it seems hardly reasonable to pay companies for the bandwidth they use. Wouldn’t that incentivize wasting bandwidth?
Which makes total sense given that video hosting is insanely expensive, especially at the scale at which YT is operating. I forget the exact number, but I heard that over half of the global internet bandwidth is used for video streaming from just a handful of websites.
That said though, I still choose Ublock Origin.
Gobbel2000@programming.devto
Cooking @lemmy.world•(Question) what should I do with this? Any ideas? (Preferably vegetarian suggestions if possible)
3·5 months agoTruffle Pizza can be very good and is relatively common in Italy. I couldn’t tell you how to make it, but you can certainly find recipes for it.
I’m living without alcohol and caffeine (except in tea and chocolate) and really never have the feeling of missing anything. Can recommend.







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.