Skip to content

shdq/algorithms-in-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

algorithms-in-js

Algorithms implementations in JavaScript

Sorting algorithms

Simple sorts

  • Bubble sort
  • Selection sort
  • Insertion sort

Efficient sorts

  • Quick sort (recursive)
  • Merge sort (recursive)

Search algorithms

  • Binary search

Recursive algorithms

  • Factorial
  • Fibonacci number for nth position
  • Greatest common divisor

Graphs

  • Undirected graph representation (adjacency list)
  • Deep-first search
  • Breadth-first search

Primes

  • Sieve of Eratosthenes

Permutations

  • Heap's algorithm

Project Euler

Expand problems (1-51)
  • Problem 1: Multiples of 3 and 5
  • Problem 2: Even Fibonacci numbers
  • Problem 3: Largest prime factor
  • Problem 4: Largest palindrome product
  • Problem 5: Smallest multiple
  • Problem 6: Sum square difference
  • Problem 7: 10001st prime
  • Problem 8: Largest product in a series
  • Problem 9: Special Pythagorean triplet
  • Problem 10: Summation of primes
  • Problem 11: Largest product in a grid
  • Problem 12: Highly divisible triangular number
  • Problem 13: Large sum
  • Problem 14: Longest Collatz sequence
  • Problem 15: Lattice paths
  • Problem 16: Power digit sum
  • Problem 17: Number letter counts
  • Problem 18: Maximum path sum I
  • Problem 19: Counting Sundays
  • Problem 20: Factorial digit sum
  • Problem 21: Amicable numbers
  • Problem 22: Names scores
  • Problem 23: Non-abundant sums
  • Problem 24: Lexicographic permutations
  • Problem 25: 1000-digit Fibonacci number
  • Problem 26: Reciprocal cycles
  • Problem 27: Quadratic primes
  • Problem 28: Number spiral diagonals
  • Problem 29: Distinct powers
  • Problem 30: Digit fifth powers
  • Problem 31: Coin sums
  • Problem 32: Pandigital products
  • Problem 33: Digit canceling fractions
  • Problem 34: Digit factorials
  • Problem 35: Circular primes
  • Problem 36: Double-base palindromes
  • Problem 37: Truncatable primes
  • Problem 38: Pandigital multiples
  • Problem 39: Integer right triangles
  • Problem 40: Champernowne's constant
  • Problem 41: Pandigital prime
  • Problem 42: Coded triangle numbers
  • Problem 43: Sub-string divisibility
  • Problem 44: Pentagon numbers
  • Problem 45: Triangular, pentagonal, and hexagonal
  • Problem 46: Goldbach's other conjecture
  • Problem 47: Distinct primes factors
  • Problem 48: Self powers
  • Problem 49: Prime permutations
  • Problem 50: Consecutive prime sum
  • Problem 51: Prime digit replacements

About

📚Algorithms implementations in JavaScript

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages