SkillAgentSearch skills...

Algorithms

List of algorithms & data structures implemented in JavaScript 💻💡 Leetcode & Codewars solutions

Install / Use

/learn @pavlokolodka/Algorithms
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

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. Sorting 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

  1. Search algorithms
  2. Graph algorithms
  3. Permutation algorithms
  4. Various algorithms
<br/>

Computational complexity

  1. Description of the kinds of bounds on asymptotic growth rates
  2. Common orders of growth
  3. Computational complexity of algorithms
<br/>

Leetcode

  1. Pascal's triangle
  2. Single number
  3. Happy number
  4. Valid Palindrome
  5. Valid Anagram
  6. Path Sum
  7. Add One Row to Tree
  8. Largest Perimeter Triangle
  9. Delete Node in a Linked List
  10. Check if the Sentence Is Pangram
  11. Integer to Roman
  12. Contains Duplicate II
<br/>

Codewars

Well-known algorithms

Sorting algorithms:

  1. Bubble sort

    #adaptive sort

    #comparison-based

  1. Quicksort

    #in-place

    #unstable sorting

    #divide and conquer

    #comparison-based

  1. Merge sort

    #divide and conquer

    #stable sorting

    #comparison-based

  1. Selection sort

    #comparison-based

  1. Heapsort

    #comparison-based

  2. Shellsort

    #comparison-based

  3. Insertion sort

    #comparison-based

Search algorithms:

  1. Binary search
  1. Largest & smallest element in an array
  1. Second largest & smallest element in an array

Graph algorithms:

  1. Breadth First Search (BFS)
  2. Depth First Search (DFS)
  3. Dijkstra
  4. Bellman Ford's algorithm

Permutation algorithms:

  1. Fisher–Yates shuffle (Knuth)
  2. Reverse

Various algorithms

  1. Fizz Buzz

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

View on GitHub
GitHub Stars4
CategoryDevelopment
Updated2y ago
Forks0

Languages

JavaScript

Security Score

55/100

Audited on Oct 7, 2023

No findings