Snippets tagged algorithm

  • Euler #5

    Euler #5 solution

    3 people like this

    Posted: 11 years ago by Michael Falanga

  • Turing machine interpreter

    A Turing machine emulator. An infinite tape is simulated by a zipper, instructions are stored in the binary tree for faster lookup.

    4 people like this

    Posted: 10 years ago by Daniil

  • Langton's ant // OOP :)

    Implementation of Langton's ant route.. Takes first 1000 steps and returns only black fields.

    4 people like this

    Posted: 10 years ago by stejcz

  • Soundex phonetic algorithm

    Soundex is a phonetic algorithm for indexing names by sound, as pronounced in English implemented in F#. https://en.wikipedia.org/wiki/Soundex

    5 people like this

    Posted: 6 years ago by Fabio Galuppo

  • Optimized Fast Fourier Transform (FFT)

    Fast Fourier Transform algorithm inspired by the snippet http://fssnip.net/dC/title/fast-Fourier-transforms-FFT-. The original snippet was a beautiful and idiomatic implementation based on the definition of FFT. This version sacrifices idioms and elegance for performance. For data sets with 1024 samples this version seems to be about 100x faster and easier on the GC.

    2 people like this

    Posted: 5 years ago by Mårten Rånge

  • Rotate or shift lists

    This rotates or shifts a list. Unlike http://www.fssnip.net/qY/title/Rotate-List, which runs exponentially, this runs at O(n). In case of overflow (i.e., shift index is larger than the size of the list) will run at most once more with the modulo. This is done to prevent using `List.length` prior to entering the function, as that would lead to a perf punishment of an extra O(n) on each invocation. For large lists, `shift largeList 1` would then get a big performance hit.

    1 people like this

    Posted: 3 months ago by Abel Braaksma

  • RSK algorithm

    Implements a bijective mapping between permutations and pairs of standard Young tableaux, both having the same shape. http://en.wikipedia.org/wiki/Robinson%E2%80%93Schensted_correspondence

    4 people like this

    Posted: 11 years ago by Ademar Gonzalez

  • Langton's ant

    Implementation of Langton's ant route.. Takes first 1000 steps and returns only black fields.

    2 people like this

    Posted: 10 years ago by stejcz

  • A simple sieve

    A simple implementation for the sieve of Eratosthenes.

    3 people like this

    Posted: 10 years ago by Gab_km

  • MurmurHash3

    An attempt to implement murmurhash version 3 in F# Original source code: https://github.com/aappleby/smhasher/blob/master/src/MurmurHash3.cpp Original author: Austin Appleby Wikpedia link: https://en.wikipedia.org/wiki/MurmurHash

    4 people like this

    Posted: 5 years ago by Mårten Lindblad

  • Lower Bound in a sorted array

    Returns the index of the first element in the sorted array that does not compare less than 'target'. The given method returns an option type to handling non matching cases. parameters: target - The value whose lower bound has to be found arr - sorted array beg - start index, usually zero en - end index, usually length of array minus one

    0 people like this

    Posted: 1 year ago by Krishna Mohan