30秒学会 JavaScript 片段 – Bucket sort
Implementation Use Math.min(), Math.max() and the spread operator (…) to find the minimum and maxi...
Implementation Use Math.min(), Math.max() and the spread operator (…) to find the minimum and maxi...
Definition Insertion sort is a simple sorting algorithm that builds the final sorted array one eleme...
Finds the first index of a given element in an array using the linear search algorithm. Use a for…...
Definition Quicksort is a divide and conquer sorting algorithm. It first divides a large array into ...
Definition The Caesar cipher is a simple substitution cipher, in which each letter is replaced by an...
Definition The Levenshtein distance is a measure of the difference between two strings. It is define...
Generates all permutations of an array’s elements (contains duplicates). Use recursion. For ea...
Finds all the indexes of a substring in a given string. Use Array.prototype.indexOf() to look for se...
Finds the prime factors of a given number using the trial division algorithm. Use a while loop to it...
Classifies a data point relative to a labelled data set, using the k-nearest neighbors algorithm. Us...