/algorithms

Algorithms

Primary LanguageJavaScript

ALGORITHMS EXERCISES

Resources:

  1. Grokking Algorithms: An illustrated guide for programmers and other curious people by Aditya Bhargava, published 2016
  2. JavaScript: The Good Parts by Douglas Crockford, published 2009

JavaScript

Algorithms implemented in JavaScript language:

  1. SELECTION SORT algorithm based on (1) - this algorithm does not actually swap indexes, but creates new array with sorted elements; Time Complexity: O(n2)

  2. SELECTION SORT algorithm based on Wikipedia "Selection sort"; Time Complexity: O(n2) as there are two nested loops.

  3. INSERTION SORT algorithm based on Wikipedia "Insertion sort" and Geeks for Geeks "Insertion sort"; Time Complexity: O(n2).

  4. RECURRENCE ALGORITHMS
    4.1 Factorial based on (2)
    4.2 Factorial based on w3resource "JavaScript: Calculate the factorial of a number

Python

Algorithms implemented in Python language:

  1. SELECTION SORT algorithm based on (1) - this algorithm does not actually swap indexes, but creates new array with sorted elements; Time Complexity: O(n2)