chore: Merge pull request #768 from lvlte/issues/720

Changes for consolidation
This commit is contained in:
Rak Laptudirm
2021-10-21 19:32:55 +05:30
committed by GitHub
153 changed files with 1084 additions and 1214 deletions

View File

@@ -1,4 +1,4 @@
const { binaryExponentiation } = require('../BinaryExponentiationRecursive')
import { binaryExponentiation } from '../BinaryExponentiationRecursive'
describe('BinaryExponentiationRecursive', () => {
it('should calculate 2 to the power of 10 correctly', () => {

View File

@@ -0,0 +1,19 @@
import { factorial, permutation, combination } from '../PermutationAndCombination'
describe('Factorial', () => {
it('factorial(5)', () => {
expect(factorial(5)).toBe(120)
})
})
describe('Permutation', () => {
it('permutation(5, 2)', () => {
expect(permutation(5, 2)).toBe(20)
})
})
describe('Combination', () => {
it('combination(5, 2)', () => {
expect(combination(5, 2)).toBe(10)
})
})