An open API service indexing awesome lists of open source software.

https://github.com/atilafassina/fundamentals

🎓Computer Science fundamentals in JavaScript.
https://github.com/atilafassina/fundamentals

algorithms computer-science-algorithms study-project

Last synced: about 1 year ago
JSON representation

🎓Computer Science fundamentals in JavaScript.

Awesome Lists containing this project

README

          


⭐ 🏈 🦄 🏀 🤘 🏉 ✨

FUNdamentals



Computer Science fundamentals in JavaScript.


Check below for recommended use-cases on each of them and relevant tradeoffs.


## Algorithms

### Binary Search

Requires a sorted `array` for it to work. Essentially a Binary Search break the array into 2 halves and check in which half range the target value may be. It's quite powerful for large data sets as it can avoid iterations, one can (should) perform a Binary Search knowing only two things: that the provided `array` is sorted (1), and the length of the given `array`(2).

[Implementation](https://github.com/atilafassina/fundamentals/tree/master/src/binarySearch)

### Insertion Sort

It‘s a simple to implement sort algorithm, not very efficient for large data sets, but quite efficiente and powerful for small ones. It can avoid confusion by not changing the order of equal set of keys. In a nutshell, Insertion Sort iterates twice through the `array`. First iteration corresponds to the target position, whilst second iteration is for comparison with future elements. Every time the current item is smaller than the comparison value, it is inserted in the current position and first iteration moves forward.

[Implementation](https://github.com/atilafassina/fundamentals/tree/master/src/insertionSort)

---

Heavily inspired on [Algorithms.JS](http://felipernb.github.io/algorithms.js/) by Felipe Ribeiro.