Skip to content

Commit 97808fc

Browse files
author
Nejc
committed
refactor: moved to github actions, updated docs
1 parent 89f2e82 commit 97808fc

File tree

7 files changed

+64
-24
lines changed

7 files changed

+64
-24
lines changed

.github/workflows/node.js.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master, beta, next, develop]
6+
pull_request:
7+
branches: [master, beta, next, develop]
8+
9+
jobs:
10+
test:
11+
name: Running tests...
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Use node.js ${{ matrix.node-version }}
17+
uses: actions/setup-node@v1
18+
with:
19+
node-version: ${{ matrix.node-version }}
20+
- name: Installing
21+
- run: npm install
22+
- name: Test
23+
- run: npm run validate
24+
25+
- name: Building docs
26+
- run: npm run docz:build
27+
- name: Deploy 🚀
28+
uses: JamesIves/github-pages-deploy-action@3.5.9
29+
with:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
BRANCH: gh-pages
32+
FOLDER: .docz/dist

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ $ npm run start
5858

5959
```
6060

61+
### Issues
62+
63+
Sometimes npm has some issues with running docs. Try using yarn instead for installing the
64+
deps and running tasks.
65+
6166
## Docs & Examples
6267

6368
Each algorithm is described on the docs website.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"test:build": "jest --coverage --colors --silent && jest-coverage-badges",
3939
"test:watch": "jest --watch",
4040
"docz:clean": "rimraf .docz && docz clean",
41-
"docz:dev": "npm run docz:clean && docz dev",
41+
"docz:dev": "docz dev",
4242
"docz:build": "npm run docz:clean && docz build",
4343
"start": "npm run docz:dev",
4444
"validate": "npm run format && npm run lint && npm run test:build",

src/docs/Algorithms/Graph/FloydWarshall.mdx

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,15 @@ menu: Graph
66

77
# Floyd warshall
88

9-
Floyd–Warshall algorithm (also known as Floyd's algorithm, the Roy–Warshall
10-
algorithm, the Roy–Floyd algorithm, or the WFI algorithm) is an algorithm for
11-
finding shortest paths in a weighted graph with positive or negative edge
12-
weights (but with no negative cycles). A single execution of the algorithm will
13-
find the lengths (summed weights) of shortest paths between all pairs of
14-
vertices. Although it does not return details of the paths themselves, it is
15-
possible to reconstruct the paths with simple modifications to the algorithm.
16-
Versions of the algorithm can also be used for finding the transitive closure of
17-
a relation {\displaystyle R}R, or (in connection with the Schulze voting system)
18-
widest paths between all pairs of vertices in a weighted graph. [Source:
19-
Wikipedia]
9+
Floyd–Warshall algorithm (also known as Floyd's algorithm, the Roy–Warshall algorithm, the
10+
Roy–Floyd algorithm, or the WFI algorithm) is an algorithm for finding shortest paths in a
11+
weighted graph with positive or negative edge weights (but with no negative cycles). A
12+
single execution of the algorithm will find the lengths (summed weights) of shortest paths
13+
between all pairs of vertices. Although it does not return details of the paths
14+
themselves, it is possible to reconstruct the paths with simple modifications to the
15+
algorithm. Versions of the algorithm can also be used for finding the transitive closure
16+
of a relation R, or (in connection with the Schulze voting system) widest paths between
17+
all pairs of vertices in a weighted graph. [Source: Wikipedia]
2018

2119
![Floyd warshall](https://upload.wikimedia.org/wikipedia/commons/thumb/2/2e/Floyd-Warshall_example.svg/2880px-Floyd-Warshall_example.svg.png)
2220

src/docs/Algorithms/Other/KnapsackProblem.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: Knapsack problem
3-
route: /algorithms/graph/knapsack-problem
3+
route: /algorithms/other/knapsack-problem
44
menu: Other
55
---
66

src/docs/Algorithms/Overview.mdx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,9 @@ typically to solve a class of problems or to perform a computation. (Source: Wik
125125
algorithm</Link>
126126
- `A` <Link className="link" to="/algorithms/graph/a-star-search-algorithm">A\* search
127127
algorithm</Link>
128+
[[Code](https://github.com/nejcm/js-algorithms/blob/master/src/algorithms/graph/a-star-search-algorithm/index.ts)]
128129

129-
**Other**
130+
**Math**
130131

131132
- `B` <Link className="link" to="/algorithms/math/combinations">Combinations</Link>
132133
- With repetitions
@@ -140,7 +141,12 @@ typically to solve a class of problems or to perform a computation. (Source: Wik
140141
[[Code](https://github.com/nejcm/js-algorithms/blob/master/src/algorithms/math/permutations/withoutRepetitions.ts)]
141142
- `B` <Link className="link" to="/algorithms/math/factorial">Factorial</Link>
142143
[[Code](https://github.com/nejcm/js-algorithms/blob/master/src/algorithms/math/factorial/index.ts)]
143-
- Knapsack problem
144+
145+
**Other**
146+
147+
- `A` <Link className="link" to="/algorithms/other/knapsack-problem">Knapsack
148+
problem</Link>
149+
[[Code](https://github.com/nejcm/js-algorithms/blob/master/src/algorithms/other/factorial/index.ts)]
144150
- Hanoi tower
145151
- Knight tour
146152
- N-queens

src/docs/Algorithms/Searching/JumpSearch.mdx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@ menu: Searching
66

77
# Jump search
88

9-
Like Binary Search, Jump Search is a searching algorithm for sorted arrays. The
10-
basic idea is to check fewer elements (than linear search) by jumping ahead by
11-
fixed steps or skipping some elements in place of searching all elements.
12-
13-
For example, suppose we have an array arr[] of size n and block (to be jumped)
14-
size m. Then we search at the indexes arr[0], arr[m], arr[2m]…..arr[km] and so
15-
on. Once we find the interval (arr[km] < x < arr[(k+1)m]), we perform a linear
16-
search operation from the index km to find the element x. (Source:
17-
Geeksforgeeks)
9+
Like Binary Search, Jump Search is a searching algorithm for sorted arrays. The basic idea
10+
is to check fewer elements (than linear search) by jumping ahead by fixed steps or
11+
skipping some elements in place of searching all elements.
12+
13+
For example, suppose we have an array arr[] of size n and block (to be jumped) size m.
14+
Then we search at the indexes arr[0], arr[m], arr[2m]…..arr[km] and so on. Once we find
15+
the interval (arr[km] < x < arr[(k+1)m]), we perform a linear search operation from the
16+
index km to find the element x. (Source: Geeksforgeeks)
1817

1918
![Algorithm Visualization](https://upload.wikimedia.org/wikipedia/commons/8/83/Jump_Search_Depiction.svg)
2019

0 commit comments

Comments
 (0)