TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

All Algorithms Implemented in Rust

81 pointsby fofozover 2 years ago

3 comments

IshKebabover 2 years ago
First one I checked was `two_sum.rs` and it uses a `HashMap`: <a href="https:&#x2F;&#x2F;github.com&#x2F;TheAlgorithms&#x2F;Rust&#x2F;blob&#x2F;master&#x2F;src&#x2F;general&#x2F;two_sum.rs" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;TheAlgorithms&#x2F;Rust&#x2F;blob&#x2F;master&#x2F;src&#x2F;genera...</a><p>Surely the best way is to sort the numbers and then walk from both ends?<p>Nice work anyway!
评论 #32548927 未加载
评论 #32548861 未加载
评论 #32548871 未加载
dwrobertsover 2 years ago
I think the Karatsuba implementation is kind of missing the point of the whole exercise by just leaning on i128’s methods. It should really be defining a big num type or doing all the work on strings etc.<p>It’s also going to explode if I put in a number with several thousand digits as it is unwrap()ing everywhere
评论 #32576334 未加载
legerdemainover 2 years ago
Finally, idiomatic and, most importantly, safe implementations of textbook algos and data structures!
评论 #32545516 未加载
评论 #32546240 未加载
评论 #32546574 未加载