Skip to content

Commit e27cced

Browse files
committedApr 12, 2018
Update READMEs.
1 parent e05d159 commit e27cced

File tree

4 files changed

+54
-40
lines changed

4 files changed

+54
-40
lines changed
 

‎README.md

+48-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
[![Build Status](https://travis-ci.org/trekhleb/javascript-algorithms.svg?branch=master)](https://travis-ci.org/trekhleb/javascript-algorithms)
44
[![codecov](https://codecov.io/gh/trekhleb/javascript-algorithms/branch/master/graph/badge.svg)](https://codecov.io/gh/trekhleb/javascript-algorithms)
55

6-
## [Data Structures](https://github.com/trekhleb/javascript-algorithms/tree/master/src/data-structures)
6+
## Code Examples
7+
8+
### Data Structures
79

810
1. [Linked List](https://github.com/trekhleb/javascript-algorithms/tree/master/src/data-structures/linked-list)
911
2. [Queue](https://github.com/trekhleb/javascript-algorithms/tree/master/src/data-structures/queue)
@@ -17,7 +19,7 @@
1719
* [AVL Tree](https://github.com/trekhleb/javascript-algorithms/tree/master/src/data-structures/tree/avl-tree)
1820
9. [Graph](https://github.com/trekhleb/javascript-algorithms/tree/master/src/data-structures/graph)
1921

20-
## [Algorithms](https://github.com/trekhleb/javascript-algorithms/tree/master/src/algorithms)
22+
### Algorithms
2123

2224
* Math
2325
* [Fibonacci Number](https://github.com/trekhleb/javascript-algorithms/tree/master/src/algorithms/math/fibonacci)
@@ -29,10 +31,6 @@
2931
* [Depth-First Search (DFS)](https://github.com/trekhleb/javascript-algorithms/tree/master/src/algorithms/graph/depth-first-search)
3032
* [Breadth-First Search (BFS)](https://github.com/trekhleb/javascript-algorithms/tree/master/src/algorithms/graph/breadth-first-search)
3133

32-
## Useful Links
33-
34-
- [Data Structures and Algorithms on YouTube](https://www.youtube.com/playlist?list=PLLXdhg_r2hKA7DPDsunoDZ-Z769jWn4R8)
35-
3634
## Running Tests
3735

3836
**Run all tests**
@@ -44,3 +42,47 @@ npm test
4442
```
4543
npm test -- -t 'LinkedList'
4644
```
45+
46+
## Playground
47+
48+
You may play with data-structures and algorithms in `./src/playground/playground.js` file and write
49+
tests for it in `./src/playground/__test__/playground.test.js`.
50+
51+
Then just simply run the following command to test if your playground code works as expected:
52+
53+
```
54+
npm test -- -t 'playground'
55+
```
56+
57+
## Useful Information
58+
59+
### Useful links
60+
61+
* [Data Structures and Algorithms on YouTube](https://www.youtube.com/playlist?list=PLLXdhg_r2hKA7DPDsunoDZ-Z769jWn4R8)
62+
* Algorithms
63+
* Dynamic Programming
64+
* [Introduction to Dynamic Programming 1](https://www.hackerearth.com/practice/algorithms/dynamic-programming/introduction-to-dynamic-programming-1/tutorial/)
65+
66+
### Big O Notation
67+
68+
Order of growth of algorithms specified in Big O notation.
69+
70+
![Big O graphs](https://github.com/trekhleb/javascript-algorithms/blob/master/assets/big-o-graph.png)
71+
Source: [Big O Cheat Sheet](http://bigocheatsheet.com/).
72+
73+
Below is the list of some of the most used Big O notations and their performance comparisons against different sizes of the input data.
74+
75+
| Big O Notation | Computations for 10 elements | Computations for 100 elements | Computations for 1000 elements |
76+
| -------------- | ---------------------------- | ----------------------------- | ------------------------------- |
77+
| **O(1)** | 1 | 1 | 1 |
78+
| **O(log N)** | 3 | 6 | 9 |
79+
| **O(N)** | 10 | 100 | 1000 |
80+
| **O(N log N)** | 30 | 60 | 9000 |
81+
| **O(N^2)** | 100 | 10000 | 1000000 |
82+
| **O(2^N)** | 1024 | 1.26e+29 | 1.07e+301 |
83+
| **O(N!)** | 3628800 | 9.3e+157 | 4.02e+2567 |
84+
85+
### Common Data Structure Operations
86+
87+
![Common Data Structure Operations](https://github.com/trekhleb/javascript-algorithms/blob/master/assets/big-o-data-structures.png)
88+
Source: [Big O Cheat Sheet](http://bigocheatsheet.com/).

‎src/algorithms/README.md

-27
This file was deleted.

‎src/data-structures/README.md

-7
This file was deleted.

‎src/playground/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@
33
You may use `playground.js` file to play with data
44
structures and algorithms. The code from `playground.js` may
55
be tested in `./__test__/playground.test.js` file.
6+
7+
To run tests simply run:
8+
9+
```
10+
npm test -- -t 'playground'
11+
```

0 commit comments

Comments
 (0)
Please sign in to comment.