TheAlgorithms / Rust

All Algorithms implemented in Rust
MIT License
22.92k stars 2.24k forks source link

Add more algorithms in Rust Language #3

Closed r0hit-gupta closed 9 months ago

r0hit-gupta commented 6 years ago

This issue is fairly easy and most beginners should be comfortable implementing algorithms of their choice in Rust. In case of any problem, raise an issue or just discuss it below.

Graphs

Dynamic Programming

Data Structures

General

Project Euler, LeetCode, etc.

0xazure commented 6 years ago

@r0hit-gupta I'm still getting my feet wet with Rust, but I wouldn't mind taking a stab at insertion & selection sort along with some tests for them.

nlynchjo commented 6 years ago

@r0hit-gupta I am also looking for a first time contribution! Mind if I take on some of the data structures?

r0hit-gupta commented 6 years ago

@0xazure @nlynchjo Please feel free to contribute and work on anything you like. Take an idea from other repositories if you do not know how to begin. Send a pull request and if there is something not right, we will let you know. Cheers!

darkkeh commented 6 years ago

@r0hit-gupta I'll take a crack at the KMP string pattern matching 👍

bofh69 commented 6 years ago

@0xazure - sorry, I didn't read your comment until now. I just added a PR with insertion sort.

0xazure commented 6 years ago

@bofh69 thanks for letting me know! I hadn't actually started implementing it yet, so I'll focus on the selection sort. I'm definitely interested in how you did it in Rust, so I'll have a look at your PR!

bofh69 commented 6 years ago

@0xazure Great! I felt a bit stupid not checking the comments here first... My solution is probably not the best, I'm still learning Rust, but now it is decent.

eisterman commented 6 years ago

I'm actually working on Merge Sort

AnshulMalik commented 6 years ago

I think there is already a PR for Merge Sort @eisterman

Jay9596 commented 6 years ago

I'd like to work on implementing Queue, if no one has claimed it.

AnshulMalik commented 6 years ago

Go ahead @Jay9596 :)

teskje commented 6 years ago

I'd like to try my hands on heap sort.

DanielSauve commented 6 years ago

I'll take a shot at making a Stack

BaxterEaves commented 6 years ago

I'm up for k-means, but i'm not aware of a dynamic programming algorithm for data with more than one dimension. I can implement the more general iterative algorithm if you like.

pickfire commented 6 years ago

I am interested in caesar cipher.

AnshulMalik commented 6 years ago

Give it a try @BaxterEaves and @pickfire 👍

elpiel commented 6 years ago

I've added another Merge Sort implementation, I will try to do some other as well PR #57 PS: I didn't see that it's already implemented :grin:

Update: Binary tree PR #58

pickfire commented 6 years ago

@AnshulMalik I have added the caesar cipher https://github.com/TheAlgorithms/Rust/pull/55

leviathanbeak commented 5 years ago

@r0hit-gupta I add PR for Longest common subsequence, still not merged ?

sstadick commented 5 years ago

I will take a crack at a few of these! It looks like there's a Radix Sort PR in progress, what's the status there?

kitlith commented 5 years ago

I noticed Linked Lists are listed, I think this does the subject the most justice: https://rust-unofficial.github.io/too-many-lists/

fabrizzioalco commented 4 years ago

Hey I'll try to do Dijkstra algorithm

douglasvmo commented 4 years ago

would like to work on coin change, what's the status?

pgimalac commented 4 years ago

I'm not sure sharing solutions of the Project Euler is a very good idea, I think it goes against the objective of the challenges...

joao-conde commented 4 years ago

@r0hit-gupta Im thinking on contributing. Can I implement the following:

  1. dynamic_programming/01_knapsack.rs
  2. dynamic_programming/coin_change.rs
marnagy commented 3 years ago

@r0hit-gupta Hello, I am a bit new to Rust, but can I make implementations of:

ghost commented 3 years ago

I wonder if there are enough reviewers in this repository. Some PR is not reviewed for months, and it reduce the committer's motivation.

pickfire commented 3 years ago

@ayaankhan98 If no one is currently maintaining it, I can help to temporary maintain the repo to reduce the amount of open pull requests and help to review them at the same time if I have time.

ayaankhan98 commented 3 years ago

@ayaankhan98 If no one is currently maintaining it, I can help to temporary maintain the repo to reduce the amount of open pull requests and help to review them at the same time if I have time.

Yes, sure @pickfire go ahead. Thanks for your support.

cfvescovo commented 3 years ago

If you need any help, count me in too. I would be glad to help you maintain the repo.

marnagy commented 3 years ago

Is there any algorithm I can help with? Contact me if I can help with anything.

jonakr commented 3 years ago

I would like to implement the following algorithms with a fellow student as a project for our Rust lecture at the Corporate University DHBW Stuttgart.

alexfertel commented 3 years ago

Hello! I see this repo is unmaintained, but I think it provides a lot of value for the community, so I decided to make my own, which you can find in https://github.com/alexfertel/rust-algorithms.

I started by adding the sorting algorithms but feel free to contribute with your own. 🚀

siriak commented 3 years ago

Hi @alexfertel, I'm cleaning up this repo at the moment and will continually review new submissions, so feel free to contribute here too :)

shadiakiki1986 commented 3 years ago

n-queens: https://github.com/insou22/typing-the-technical-interview-rust/

MatheusMuriel commented 3 years ago

Hello, i will work on DFS Graph Algorithm

iamdejan commented 3 years ago

Kruskal is already in PR: https://github.com/TheAlgorithms/Rust/pull/129

Azeajr commented 3 years ago

Hello, I wanted to work on Queue since PR: #25 was closed. Or should I work on a different algorithm?

Forget it just checked the actual repo and I see that queue is implemented. #229

Instead has anyone started working on BFS?

siriak commented 3 years ago

@Azeajr seems like no one is working on that at the moment, but you can check open PRs to be sure

elpiel commented 3 years ago

Dijstra is actually implemented but not marked as one @r0hit-gupta

github-actions[bot] commented 3 years ago

This issue has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

erfan-khadem commented 2 years ago

I think we can implement some items on this list:

Math

I'm sure I'm missing many algorithms.

mime8 commented 2 years ago

Hi, all! I'd like to work on ternary search algorithm, if no one else is working on it.

erfan-khadem commented 2 years ago

Hi, all! I'd like to work on ternary search algorithm, if no one else is working on it.

Awesome! I added your name to the list.

b42thomas commented 2 years ago

Hey y'all, I'm looking to make my first contribution. I would like to work on the matrix operations. Should that be separated into different PRs for addition, subtraction and multiplication?

siriak commented 2 years ago

@b42thomas depending on how complex they are. If you're implementing naive approaches, they can be merged together, if some complex algorithms, better to do them separately

erfan-khadem commented 2 years ago

@siriak I have a question: I want to implement a few graph algorithms, and if they are represented using BTreeMap, a log(n) factor would be added to their time complexity (obviously.) So can I only implement the algorithms for graphs with vertices numbered from 1 to n and having &[Vec<usize>] as their adjacency list?

I know we are supposed to create generic algorithms, but adding a log(n) to max flow wouldn't make anyone happy.

siriak commented 2 years ago

@er888kh, I think we can have both versions. Depending on the task at hand, both can be useful.

erfan-khadem commented 2 years ago

@er888kh, I think we can have both versions. Depending on the task at hand, both can be useful.

That's certainly an option, but it would create a lot of duplication (or at least generics boiler plate)

Another solution is to have a seperate implementation that enumerates graphs represented using BTreeMap to a convenient representation. Then anyone can use that instead. As an added bonus, this solution wouldn't change the time complexity, as iterating over a BTree can be done in O(n).

I will implement the option you choose (my code wouldn't be ready for at least a few days though, I'm too busy)

siriak commented 2 years ago

Agree, let's implement for the from 1 to n case then