| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,7 +3,9 @@ | |||
| 3 | 3 | [](https://travis-ci.org/trekhleb/javascript-algorithms) | |
| 4 | 4 | [](https://codecov.io/gh/trekhleb/javascript-algorithms) | |
| 5 | 5 | ||
| 6 | - ## [Data Structures](https://github.com/trekhleb/javascript-algorithms/tree/master/src/data-structures) | ||
| 6 | + ## Code Examples | ||
| 7 | + | ||
| 8 | + ### Data Structures | ||
| 7 | 9 | ||
| 8 | 10 | 1. [Linked List](https://github.com/trekhleb/javascript-algorithms/tree/master/src/data-structures/linked-list) | |
| 9 | 11 | 2. [Queue](https://github.com/trekhleb/javascript-algorithms/tree/master/src/data-structures/queue) | |
@@ -17,7 +19,7 @@ | |||
| 17 | 19 | * [AVL Tree](https://github.com/trekhleb/javascript-algorithms/tree/master/src/data-structures/tree/avl-tree) | |
| 18 | 20 | 9. [Graph](https://github.com/trekhleb/javascript-algorithms/tree/master/src/data-structures/graph) | |
| 19 | 21 | ||
| 20 | - ## [Algorithms](https://github.com/trekhleb/javascript-algorithms/tree/master/src/algorithms) | ||
| 22 | + ### Algorithms | ||
| 21 | 23 | ||
| 22 | 24 | * Math | |
| 23 | 25 | * [Fibonacci Number](https://github.com/trekhleb/javascript-algorithms/tree/master/src/algorithms/math/fibonacci) | |
@@ -29,10 +31,6 @@ | |||
| 29 | 31 | * [Depth-First Search (DFS)](https://github.com/trekhleb/javascript-algorithms/tree/master/src/algorithms/graph/depth-first-search) | |
| 30 | 32 | * [Breadth-First Search (BFS)](https://github.com/trekhleb/javascript-algorithms/tree/master/src/algorithms/graph/breadth-first-search) | |
| 31 | 33 | ||
| 32 | - ## Useful Links | ||
| 33 | - | ||
| 34 | - - [Data Structures and Algorithms on YouTube](https://www.youtube.com/playlist?list=PLLXdhg_r2hKA7DPDsunoDZ-Z769jWn4R8) | ||
| 35 | - | ||
| 36 | 34 | ## Running Tests | |
| 37 | 35 | ||
| 38 | 36 | **Run all tests** | |
@@ -44,3 +42,47 @@ npm test | |||
| 44 | 42 | ``` | |
| 45 | 43 | npm test -- -t 'LinkedList' | |
| 46 | 44 | ``` | |
| 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 | +  | ||
| 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 | +  | ||
| 88 | + Source: [Big O Cheat Sheet](http://bigocheatsheet.com/). | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,3 +3,9 @@ | |||
| 3 | 3 | You may use `playground.js` file to play with data | |
| 4 | 4 | structures and algorithms. The code from `playground.js` may | |
| 5 | 5 | be tested in `./__test__/playground.test.js` file. | |
| 6 | + | ||
| 7 | + To run tests simply run: | ||
| 8 | + | ||
| 9 | + ``` | ||
| 10 | + npm test -- -t 'playground' | ||
| 11 | + ``` | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments