TheAlgorithms / C-Sharp

All algorithms implemented in C#.
GNU General Public License v3.0
6.95k stars 1.49k forks source link

Add more algorithms #111

Closed siriak closed 1 year ago

siriak commented 5 years ago

Feel free to propose and/or implement new algorithms, I will add them to the list below :) List of algorithms that would be great to see in this repo:

kaydotdev commented 4 years ago

[Numeric] LU decomposition (and elimination).

siriak commented 4 years ago

@antonAce added LU decomposition to the list, feel free to implement those or any other algorithms :D

kaydotdev commented 4 years ago

@siriak implementation is ready!

kaydotdev commented 4 years ago

@siriak, talking about decomposition: [Numeric] Singular Value Decomposition (+ pseudoinverse matrix algorithm, homogeneous linear equations elimination algorithm, cuz they're related to the SVD-decomposition)

hebero commented 4 years ago

Phonetics algorithms implementations? Like NYSIIS or Soundex?

siriak commented 4 years ago

@hebero I've added them to the list. It would be great if you could implement some of them in case you happen to have some spare time for that of course :D

antonykamp commented 3 years ago

I could implement the Boyer-Moore algorithm and additionally the Rabin-Karp algorithm (in my opinion it's the easiest way to find a substring)

siriak commented 3 years ago

I could implement the Boyer-Moore algorithm and additionally the Rabin-Karp algorithm (in my opinion it's the easiest way to find a substring)

Cool, go ahead!

uday9405 commented 3 years ago

Can I implement sorting algorithms like Merge sort and Quick sort?

avenmia commented 3 years ago

I can do the Fibonacci problem. Given a number N find the Nth Fibonacci number.

NikitaYermak commented 3 years ago

Hi @siriak, I think the Luhn algorithm should be on the list because it is a simple checksum formula that is used to validate various identification numbers such as credit card numbers. Namely, to identify errors caused by unintentional data corruption. I can also implement this algorithm.

siriak commented 3 years ago

@NikitaYermak added Luhn algorithm

simolab99 commented 3 years ago

Are you interested in these algorithms? (they were adapted from the Java version of TheAlgoritms)

siriak commented 3 years ago

@simolab99 Aliquot Sum - definitely Perfect Cube - a sequence of perfect cubes? Why not, looks interesting Perfect Number - yes Perfect Square - same as the perfect cube Prime Number - we already have a sequence of prime numbers, but you are welcome to add something new (maybe efficient primality tests?) Narcissistic Number (Armstrong Number) - yes But keep in mind that the algorithms must be efficient if possible

GF1977 commented 2 years ago

Added Rabin–Miller primality test (probabilistic primality test)

iamstan13y commented 2 years ago

I could implement the Keith Number Algorithm.

kolosovpetro commented 2 years ago

Suggest to implement:

1) Kahn Topological Sort (Graph Algorithms) 2) Coin Change Dynamic (Problems) 3) Priority Queue, Based on Heapsort with maintaned Heap property via Floyd's Algorithm (Data Structures)

gabcoroba commented 2 years ago

I could implement the Exponential Search algorithm since it hasn't been implemented. Not exponential time as the name implies but O(Log i) where i is the index of the element searched. https://en.wikipedia.org/wiki/Exponential_search#:~:text=This%20is%20because%20exponential%20search,of%20elements%20in%20the%20list.

gabcoroba commented 2 years ago

I have submitted a PR for this algorithm

MatthiasHeinz commented 2 years ago

@siriak "Jump search" has already been implemented in 56d1434aa8f00af3e6d38b6b47ee935d0441745a; you can mark this one as done.

Jenn-1212 commented 2 years ago

@siriak can I add Z algorithm which help to find all occurrences of a pattern in a text in linear time

Dalfonso06 commented 2 years ago

@siriak I noticed that there aren't any breadth-first search algorithms for binary trees, could implement them along with functions that use bfs such as getHeight?

siriak commented 1 year ago

Closing this as the issue got unwieldy! Let's have all proposed algorithms tracked as separate issues.