Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
J

javascript-algorithms

> DevOps
Open source

📝 Algorithms and data structures implemented in JavaScript with explanations and links to further readings

196.4K stars0 likes3 views
WebsiteGitHub

About

📝 Algorithms and data structures implemented in JavaScript with explanations and links to further readings

JavaScript Algorithms and Data Structures

🇺🇦 UKRAINE IS BEING ATTACKED BY RUSSIAN ARMY. CIVILIANS ARE GETTING KILLED. RESIDENTIAL AREAS ARE GETTING BOMBED.

  • Help Ukraine via:
    • Serhiy Prytula Charity Foundation
    • Come Back Alive Charity Foundation
    • National Bank of Ukraine
  • More info on war.ukraine.ua and MFA of Ukraine

This repository contains JavaScript based examples of many popular algorithms and data structures.

Each algorithm and data structure has its own separate README with related explanations and links for further reading (including ones to YouTube videos).

Read this in other languages: 简体中文, 繁體中文, 한국어, 日本語, Polski, Français, Español, Português, Русский, Türkçe, Italiano, Bahasa Indonesia, Українська, Arabic, Tiếng Việt, Deutsch, Uzbek, עברית Data Structures

A data structure is a particular way of organizing and storing data in a computer so that it can be accessed and modified efficiently. More precisely, a data structure is a collection of data values, the relationships among them, and the functions or operations that can be applied to the data.

Remember that each data has its own trade-offs. And you need to pay attention more to why you're choosing a certain data structure than to how to implement it.

B - Beginner, A - Advanced

  • B Linked List
  • B Doubly Linked List
  • B Queue
  • B Stack
  • B Deque - double-ended queue
  • B Hash Table
  • B Heap - max and min heap versions
  • B Priority Queue
  • A Trie
  • A Tree
    • A Binary Search Tree
    • A AVL Tree
    • A Red-Black Tree
    • A Segment Tree - with min/max/sum range queries examples
    • A Fenwick Tree (Binary Indexed Tree)
  • A Graph (both directed and undirected)
  • A Disjoint Set - a union–find data structure or merge–find set
  • A Bloom Filter
  • A LRU Cache - Least Recently Used (LRU) cache Algorithms

An algorithm is an unambiguous specification of how to solve a class of problems. It is a set of rules that precisely define a sequence of operations.

B - Beginner, A - Advanced Algorithms by Topic

  • Math
    • B Bit Manipulation - set/get/update/clear bits, multiplication/division by two, make negative etc.
    • B Binary Floating Point - binary representation of the floating-point numbers.
    • B Factorial
    • B Fibonacci Number - classic and closed-form versions
    • B Prime Factors - finding prime factors and counting them using Hardy-Ramanujan's theorem
    • B Primality Test (trial division method)
    • B Euclidean Algorithm - calculate the Greatest Common Divisor (GCD)
    • B Least Common Multiple (LCM)
    • B Sieve of Eratosthenes - finding all prime numbers up to any given limit
    • B Is Power of Two - check if the number is power of two (naive and bitwise algorithms)
    • B Pascal's Triangle
    • B Complex Number - complex numbers and basic operations with them
    • B Radian & Degree - radians to degree and backwards conversion
    • B Fast Powering
    • B Horner's method - polynomial evaluation
    • B Matrices - matrices and basic matrix operations (multiplication, transposition, etc.)
    • B Euclidean Distance - distance between two points/vectors/matrices
    • A Integer Partition
    • A Square Root - Newton's method
    • A Liu Hui π Algorithm - approximate π calculations based on N-gons
    • A Discrete Fourier Transform - decompose a function of time (a signal) into the frequencies that make it up
  • Sets
    • B Cartesian Product - product of multiple sets
    • B Fisher–Yates Shuffle - random permutation of a finite sequence
    • A Power Set - all subsets of a set (bitwise, backtracking, and cascading solutions)
    • A Permutations (with and without repetitions)
    • A Combinations (with and without repetitions)
    • A Longest Common Subsequence (LCS)
    • A Longest Increasing Subsequence
    • A Shortest Common Supersequence (SCS)
    • A Knapsack Problem - "0/1" and "Unbound" ones
    • A Maximum Subarray - "Brute Force" and "Dynamic Programming" (Kadane's) versions
    • A Combination Sum - find all combinations that form specific sum
  • Strings
    • B Hamming Distance - number of positions at which the symbols are different
    • B Palindrome - check if the string is the same in reverse
    • A Levenshtein Distance - minimum edit distance between two sequences
    • A Knuth–Morris–Pratt Algorithm (KMP Algorithm) - substring search (pattern matching)
    • A Z Algorithm - substring search (p

Issues· 408 open

View all issuesOpen on GitHub
  • #2221

    [TEL] Telugu Language Translation / తెలుగు భాష అనువాదము

    Updated Sep 30, 2026
  • #1061

    Add Animations to Algorithms

    Updated Sep 17, 2026
  • #616

    Add Matrix Chain Multiplication in DP

    Updated Sep 1, 2026
  • #2057

    Incorrect Cycle Path Construction in detectUndirectedCycle

    Updated Jul 16, 2026
  • #2102

    BinarySearchTreeNode removing

    Updated Jun 17, 2026
  • #1085

    Would be great to see `discussions` tab brought to this repository

    Updated Mar 6, 2026
  • #2085

    zh-TW translations missing — should contributors help complete?

    Updated Feb 5, 2026
  • #527

    Creat A site web for both phone and pc

    Updated Jan 16, 2026
  • #2048

    Feature Request: Add TypeScript Type Definitions

    Updated Dec 22, 2025
  • #880

    [Typo] README.md

    Updated Nov 23, 2025

> Tags

JavaScriptalgorithmalgorithmscomputer-sciencedata-structures

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedOct 2, 2026
CategoryDevOps
PricingOpen source

> Related tools

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理