Algorithms
List of algorithms & data structures implemented in JavaScript 💻💡 Leetcode & Codewars solutions
Install / Use
/learn @pavlokolodka/AlgorithmsREADME
About
In this repository you can find algorithms & data structures in the pure JavaScript language.
The goal is to systematize and consolidate knowledge of algorithms.
Table of contents:
Well-known algorithms
1.1 Bubble sort
1.2 Quicksort
1.3 Mergesort
1.4 Selection sort
1.5 Heapsort
1.6 Shellsort
1.7 Insertion sort
<br/>Computational complexity
- Description of the kinds of bounds on asymptotic growth rates
- Common orders of growth
- Computational complexity of algorithms
Leetcode
- Pascal's triangle
- Single number
- Happy number
- Valid Palindrome
- Valid Anagram
- Path Sum
- Add One Row to Tree
- Largest Perimeter Triangle
- Delete Node in a Linked List
- Check if the Sentence Is Pangram
- Integer to Roman
- Contains Duplicate II
Codewars
Well-known algorithms
Sorting algorithms:
-
Bubble sort

- Quick sort with built-in methods
- Pure quick sort
- Classic quick sort (Hoare partition scheme)
- Optimized classic quick sort (Hoare partition scheme)
-
Merge sort

-
Selection sort

-
Heapsort

-
Shellsort

-
Insertion sort

Search algorithms:
- Binary search
- Largest & smallest element in an array
- Second largest & smallest element in an array
Graph algorithms:
- Breadth First Search (BFS)
- Depth First Search (DFS)
- Dijkstra
- Bellman Ford's algorithm
Permutation algorithms:
Various algorithms
Computational complexity
<br/>Computational complexity is a complexity that expresses the dependence of the algorithm's workload on the input data. The amount of work includes time and space (the amount of memory) computational complexity. This area attempts to answer the central question of algorithm design: "how will the execution time and the amount of memory occupied change depending on the size of the input?" The main classes of complexity are:
Class P - problems for which there are fast solutions - sorting, array searching, matrix multiplication, and others. Algorithms of class P are called polynomial - the running time of which does not depend too much on the size of the input data (that is, the time does not exceed the polynomial of the data size).
Class NP - In the theory of algorithms class NP (from non-deterministic polynomial) is a set of decidability problems (where you can answer is solvable or not), whose solution can be checked on the Turing machine in time, not exceeding the value of a polynomial of the size of the input data, in the presence of some additional information (the so-called solution certificate). Any problem of class NP can be solved by brute force (kind of like bruteforcing, exponential complexity). Roughly speaking, these are complex problems that take a very long time to solve(factorial, exponential) and for which there is no optimally fast algorithm. Examples: Hamiltonian path problem, the traveling salesman problem.
Time complexity - computation complexity, that is defined from the input data determining the number of operations and equal to the algorithm's running time with the given input data. The time complexity of an algorithm is usually expressed using asymptotic analysis. <br/> Not to be confused with runtime which describes how
Related Skills
node-connect
347.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
108.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。

