Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/benoitvallon/computer-science-in-javascript

Computer science reimplemented in JavaScript
https://github.com/benoitvallon/computer-science-in-javascript

computer-science data-structures javascript list sorting-algorithms tree

Last synced: 1 day ago
JSON representation

Computer science reimplemented in JavaScript

Awesome Lists containing this project

README

        

# Computer Science in JavaScript (ES5 and ES6)

This repository contains code about various series of posts that I made [on my blog](http://blog.benoitvallon.com) about computer science (mostly data structures and sorting algorithms) reimplemented in JavaScript.

## What's in this repository?

As of now, it contains 2 main sections:

- [Data structures in JavaScript (ES5 and ES6)](https://github.com/benoitvallon/computer-science-in-javascript/tree/master/data-structures-in-javascript)
- [Sorting algorithms in JavaScript (ES5 and ES6)](https://github.com/benoitvallon/computer-science-in-javascript/tree/master/sorting-algorithms-in-javascript)

## The #data-structures series

The [#data-structures series](http://blog.benoitvallon.com/category/data-structures-in-javascript) is a collection of posts about reimplemented data structures in JavaScript.

If you are not familiar with data structures, a quick introduction and the full list of reimplemented data structures can be found in the [introduction post of the series on data structures in JavaScript](http://blog.benoitvallon.com/data-structures-in-javascript/data-structures-in-javascript).

If you feel comfortable with the concept of each data structure and only want to see the code, have a look at the summary post of the series. It removes all explanations and contains only the [JavaScript code for all data structures](http://blog.benoitvallon.com/data-structures-in-javascript/data-structures-in-javascript-all-the-code) discussed in the series.

### The data structures in the series

- [x] Array
- [x] Hash Table
- [x] Set
- [x] Singly Linked List
- [x] Doubly Linked List
- [x] Stack
- [x] Queue
- [x] Tree
- [x] Binary Search Tree
- [x] Trie
- [x] Graph

## The #sorting-algorithms series

The [#sorting-algorithms series](http://blog.benoitvallon.com/category/sorting-algorithms-in-javascript) is a collection of posts about reimplemented sorting algorithms in JavaScript.

If you are not familiar with sorting algorithms, a quick introduction and the full list of reimplemented sorting algorithms can be found in the [introduction post of the series on sorting algorithms in JavaScript](http://blog.benoitvallon.com/sorting-algorithms-in-javascript/sorting-algorithms-in-javascript).

If you feel comfortable with the concept of each sorting algorithms and only want to see the code, have a look at the summary post of the series. It removes all explanations and contains only the [JavaScript code for all sorting algorithms](http://blog.benoitvallon.com/sorting-algorithms-in-javascript/sorting-algorithms-in-javascript-all-the-code) discussed in the series.

### The sorting algorithms in the series

- [x] Bubble sort
- [x] Selection sort
- [x] Insertion sort
- [x] Shellsort
- [x] Merge sort
- [x] Quicksort

### A good way to compare all of them

Unlike the [data structures](http://blog.benoitvallon.com/data-structures-in-javascript/data-structures-in-javascript/), all [sorting algorithms](http://blog.benoitvallon.com/sorting-algorithms-in-javascript/sorting-algorithms-in-javascript) have the same goal and they can all take the same input data. So, for every sorting algorithms of the series, we are going sort an `array` of 10 numbers from 1 to 10.

By doing so we will be able to compare the different sorting algorithms more easily. Sorting algorithms are very sensitive to the input data so we will also try different input data to see how they affect the performances.

## Why this repository?

At the beginning I started those series with 2 different repositories, one for the data structures and another one for the sorting algorithms. It was nice to keep things separately at first but grouping them into the same repository makes more sense to me now.

All computer science concepts are located at the same place and it will allow me to add even more things in the future. Moreover, it won’t be mandatory that those things will be about data structures or sorting algorithms. There are other important things to know too.