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.
- 9 Posts
- 169 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·1 个月前Number only, get out of here with superfluous symbols. I don’t need The Status Bar: Illustrated Edition.
I 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 个月前I’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 个月前The 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
161·3 个月前Not 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 个月前I 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 个月前I 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 个月前There 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
31·4 个月前He 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 个月前I 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 个月前Please show me songs about eigenvalues.
I would be a bit more in agreement if they added things like automatic speed throttling based on the current road’s speed limit. That would be a big advancement in safety. But I assume people will readily keep buying cars with constant surveillance, however find it unacceptable if they can’t break the speed limit.
High fat content I believe, as in rich in fat.
Gobbel2000@programming.devto
Europe@feddit.org•BBC News: Orbán concedes victory to MagyarEnglish
6·5 个月前It really is amazing that the Orbman was supported both by Trump and by Putin. This is a great win for all Europeans, but of course especially for the Hungarians. Let’s hope that Peter Hungarian will be able to live up to his expectations.












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.