TheAlgorithms / C-Sharp

All algorithms implemented in C#.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add more algorithms

siriak opened this issue · comments

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:

  • Jump search
  • Z-block substring search
  • Homogeneous linear equations elimination algorithm
  • MinHash
  • FAME algorithm
  • Chlamtac-Jain P-squared algorithm
  • Welford's algorithm
  • Kahn Topological Sort (Graph Algorithms)
  • Coin Change Dynamic (Problems)
  • Priority Queue, Based on Heapsort with maintained Heap property via Floyd's Algorithm (Data Structures)

[Numeric] LU decomposition (and elimination).

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

@siriak implementation is ready!

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

Phonetics algorithms implementations? Like NYSIIS or Soundex?

@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

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)

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!

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

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

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.

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

  • Absolute Max
  • Absolute Min
  • Absolute Value
  • Aliquot Sum
  • Various areas calculations
  • Perfect Cube
  • Perfect Number
  • Perfect Square
  • Prime Number
  • Narcissistic Number (Armstrong Number)

@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

Added Rabin–Miller primality test (probabilistic primality test)

I could implement the Keith Number Algorithm.

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)

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.

I have submitted a PR for this algorithm

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

commented

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

@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?

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