ALGORITHMS EXERCISES
Resources:
- Grokking Algorithms: An illustrated guide for programmers and other curious people by Aditya Bhargava, published 2016
- JavaScript: The Good Parts by Douglas Crockford, published 2009
JavaScript
Algorithms implemented in JavaScript language:
-
SELECTION SORT algorithm based on (1) - this algorithm does not actually swap indexes, but creates new array with sorted elements; Time Complexity: O(n2)
-
SELECTION SORT algorithm based on Wikipedia "Selection sort"; Time Complexity: O(n2) as there are two nested loops.
-
INSERTION SORT algorithm based on Wikipedia "Insertion sort" and Geeks for Geeks "Insertion sort"; Time Complexity: O(n2).
-
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:
- SELECTION SORT algorithm based on (1) - this algorithm does not actually swap indexes, but creates new array with sorted elements; Time Complexity: O(n2)