Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

✨ A collection of algorithms written in JavaScript

NotificationsYou must be signed in to change notification settings

koalamango/js-algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What's an algorithm?

An algorithm is a set of instruction to solve problems.

Still confused?Watch the videoof Professor David J. Malan explains how algorithms can be used in seeminglysimple situations and also complex ones.

List of common algorithms

Fizz-Buzz is a group word game for children to teach them about division.Players take turns to count incrementally, replacing any multiple of threewith the word "fizz", and any multiple of five with the word "buzz".

You are given an array of n integers and a number k. Determine whether there is a pairof elements in the array that sums to exactly k. For example, given the array [1, 3, 7] andk = 8, the answer is "yes" but given k = 6 the answer is "no"

The harmless ransom note is simply a note made of words cut out from a magazine text.

You have been given two strings. You have to find out whether you can make up thefirst string with the words present in the second string.

A palindrome is a word, phrase, number or sequence of words that reads the same backwardas forward. Punctuation and spaces between the words or lettering is allowed.

Caesar cipher is to replace each plaintext letter with a different one a fixed number ofplaces down the alphabet. The cipher illustrated here uses a left shift of three, so that(for example) each occurrence of E in the plaintext becomes B in the ciphertext.

Reverse the string without using array.prototype.reverse().

Reverse the order of the elements of an array.

Calculate the mean, median, or mode of a data set!

The Fibonacci Sequence is the series of numbers: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, . . .Each subsequent number is the sum of the previous two.

Write a function to return an n element in Fibonacci sequence

In mathematics, the sieve of Eratosthenes is an ancient algorithm for finding all primenumbers up to any given limit. It does so by iteratively marking as composite (i.e.,not prime) the multiples of each prime, starting with the first prime number, 2.

Given a number n, print all primes smaller than or equal to n. It is also given that nis a small number.

Given an array of stock prices over time, need to figure out the best buy and sell priceso that we get the maximum profit. The selling should occur after buying of the stock.

  • Plurality (winner take all)

In the plurality vote, every voter gets to vote for one candidate. At the endof the election, whichever candidate has the greatest number of votes isdeclared the winner of the election.

  • Runoff

In a ranked-choice system, voters can vote for more than one candidate. Insteadof just voting for their top choice, they can rank the candidates in order ofpreference.

  • Readability
  • Liner Search
  • Binary Search
  • Bubble Sort
  • Selection Sort
  • Insertion Sort
  • Recursion
  • Merge Sort

About

✨ A collection of algorithms written in JavaScript

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp