Tag algorithmic snippets

This commit is contained in:
Chalarangelo
2020-12-28 13:49:24 +02:00
parent 487884e094
commit f1e7ea5116
15 changed files with 16 additions and 16 deletions

View File

@ -1,6 +1,6 @@
---
title: arithmeticProgression
tags: math,beginner
tags: math,algorithm,beginner
---
Creates an array of numbers in the arithmetic progression, starting with the given positive integer and up to the specified limit.
@ -8,7 +8,7 @@ Creates an array of numbers in the arithmetic progression, starting with the giv
- Use `Array.from()` to create an array of the desired length, `lim/n`, and a map function to fill it with the desired values in the given range.
```js
const arithmeticProgression = (n, lim) =>
const arithmeticProgression = (n, lim) =>
Array.from({ length: Math.ceil(lim / n) }, (_, i) => (i + 1) * n );
```

View File

@ -1,6 +1,6 @@
---
title: binomialCoefficient
tags: math,beginner
tags: math,algorithm,beginner
---
Calculates the number of ways to choose `k` items from `n` items without repetition and without order.

View File

@ -1,6 +1,6 @@
---
title: distance
tags: math,beginner
tags: math,algorithm,beginner
---
Calculates the distance between two points.

View File

@ -1,6 +1,6 @@
---
title: factorial
tags: math,recursion,beginner
tags: math,algorithm,recursion,beginner
---
Calculates the factorial of a number.

View File

@ -1,6 +1,6 @@
---
title: fibonacci
tags: math,intermediate
tags: math,algorithm,intermediate
---
Generates an array, containing the Fibonacci sequence, up until the nth term.

View File

@ -1,6 +1,6 @@
---
title: gcd
tags: math,recursion,beginner
tags: math,algorithm,recursion,beginner
---
Calculates the greatest common divisor between two or more numbers/arrays.

View File

@ -1,6 +1,6 @@
---
title: geometricProgression
tags: math,intermediate
tags: math,algorithm,intermediate
---
Initializes an array containing the numbers in the specified range where `start` and `end` are inclusive and the ratio between two terms is `step`.

View File

@ -1,6 +1,6 @@
---
title: hammingDistance
tags: math,intermediate
tags: math,algorithm,intermediate
---
Calculates the Hamming distance between two values.

View File

@ -1,6 +1,6 @@
---
title: isPrime
tags: math,beginner
tags: math,algorithm,beginner
---
Checks if the provided integer is a prime number.

View File

@ -1,6 +1,6 @@
---
title: lcm
tags: math,recursion,intermediate
tags: math,algorithm,recursion,intermediate
---
Calculates the least common multiple of two or more numbers.

View File

@ -1,6 +1,6 @@
---
title: luhnCheck
tags: math,advanced
tags: math,algorithm,advanced
---
Implementation of the [Luhn Algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm) used to validate a variety of identification numbers, such as credit card numbers, IMEI numbers, National Provider Identifier numbers etc.

View File

@ -1,6 +1,6 @@
---
title: permutations
tags: array,recursion,advanced
tags: array,algorithm,recursion,advanced
---
Generates all permutations of an array's elements (contains duplicates).

View File

@ -1,6 +1,6 @@
---
title: powerset
tags: math,beginner
tags: math,algorithm,beginner
---
Returns the powerset of a given array of numbers.

View File

@ -1,6 +1,6 @@
---
title: primes
tags: math,intermediate
tags: math,algorithm,intermediate
---
Generates primes up to a given number, using the Sieve of Eratosthenes.

View File

@ -1,6 +1,6 @@
---
title: vectorDistance
tags: math,beginner
tags: math,algorithm,beginner
---
Calculates the distance between two vectors.