C-Sharp icon indicating copy to clipboard operation
C-Sharp copied to clipboard

Add more algorithms

Open siriak opened this issue 6 years ago • 21 comments
trafficstars

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:

  • [x] 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)

siriak avatar Sep 06 '19 13:09 siriak

[Numeric] LU decomposition (and elimination).

kaydotdev avatar Apr 15 '20 11:04 kaydotdev

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

siriak avatar Apr 15 '20 12:04 siriak

@siriak implementation is ready!

kaydotdev avatar Apr 17 '20 20:04 kaydotdev

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

kaydotdev avatar Apr 21 '20 10:04 kaydotdev

Phonetics algorithms implementations? Like NYSIIS or Soundex?

hebero avatar Jul 22 '20 03:07 hebero

@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

siriak avatar Jul 22 '20 16:07 siriak

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)

antonykamp avatar Sep 26 '20 08:09 antonykamp

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!

siriak avatar Sep 26 '20 09:09 siriak

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

uday9405 avatar Oct 20 '20 08:10 uday9405

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

avenmia avatar Oct 24 '20 17:10 avenmia

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.

NikitaYermak avatar Oct 28 '20 22:10 NikitaYermak

@NikitaYermak added Luhn algorithm

siriak avatar Oct 29 '20 06:10 siriak

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 avatar Feb 10 '21 13:02 simolab99

@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

siriak avatar Feb 10 '21 19:02 siriak

Added Rabin–Miller primality test (probabilistic primality test)

GF1977 avatar Oct 10 '21 20:10 GF1977

I could implement the Keith Number Algorithm.

iamstan13y avatar Oct 13 '21 12:10 iamstan13y

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)

kolosovpetro avatar Dec 09 '21 12:12 kolosovpetro

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 avatar Jan 31 '22 02:01 gabcoroba

I have submitted a PR for this algorithm

gabcoroba avatar Jan 31 '22 05:01 gabcoroba

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

MatthiasHeinz avatar Jul 30 '22 13:07 MatthiasHeinz

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

Jenn-1212 avatar Aug 07 '22 14:08 Jenn-1212

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

Dalfonso06 avatar Sep 21 '22 23:09 Dalfonso06

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

siriak avatar Apr 13 '23 12:04 siriak