Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e951caf

Browse files
refactor: formatted files
1 parent f5cc77f commit e951caf

File tree

24 files changed

+278
-225
lines changed

24 files changed

+278
-225
lines changed

‎README.md‎

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
<h1 align="center">
32
Sorting Algorithm Visualizer
43
</h1>
@@ -7,40 +6,42 @@ This project was part of my thesis work. It is a visualizer application made wit
76
</p>
87
<p align="center">Application live on: https://algo-react-viz.netlify.app</p>
98

10-
119
---
10+
1211
<p align="center">
1312
<img align="center" src="./docs/visualization.gif"/>
1413
</p>
1514

1615
---
1716

1817
### Tech stack:
19-
- React
20-
- TypeScript
21-
- Redux
22-
- React-Router
23-
- SASS
24-
- Babel
25-
- Webpack
18+
19+
- React
20+
- TypeScript
21+
- Redux
22+
- React-Router
23+
- SASS
24+
- Babel
25+
- Webpack
2626
- Eslint
2727

2828
### To run the project locally, clone the project and run:
2929

30-
````bash
30+
```bash
3131
npm install && npm start
32-
````
33-
Or
32+
```
3433

35-
````bash
34+
Or
35+
36+
```bash
3637
yarn install && yarn start
37-
````
38-
Or
38+
```
3939

40-
````bash
41-
pnpm install && pnpm start
42-
````
40+
Or
4341

42+
```bash
43+
pnpm install && pnpm start
44+
```
4445

4546
<p align="center">
4647
<em>@bkrmadtya 2021</em>

‎docs/BasicHTML.md‎

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,21 @@
77
<tr>
88
<td>
99

10-
```html
11-
<!DOCTYPE html>
12-
<html lang="en">
13-
<head>
14-
<title>Basic HTML web page</title>
15-
</head>
16-
<body>
17-
<h3>Hello world!</h3>
18-
</body>
19-
</html>
20-
```
10+
```html
11+
<!DOCTYPE html>
12+
<html lang="en">
13+
<head>
14+
<title>Basic HTML web page</title>
15+
</head>
16+
<body>
17+
<h3>Hello world!</h3>
18+
</body>
19+
</html>
20+
```
21+
2122
</td>
2223
<td align="center">
2324
<h3>Hello world!</h3>
2425
</td>
2526
</tr>
26-
</table>
27+
</table>

‎docs/BasicHTMLwithStyle.md‎

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,26 @@
2222
<tr>
2323
<td>
2424

25-
```html
26-
<!DOCTYPE html>
27-
<html lang="en">
28-
<head>
29-
<title>Basic HTML web page</title>
30-
<style>
31-
h3 {
32-
color: red;
33-
}
34-
</style>
35-
</head>
36-
<body>
37-
<h3>Hello world!</h3>
38-
</body>
39-
</html>
40-
```
25+
```html
26+
<!DOCTYPE html>
27+
<html lang="en">
28+
<head>
29+
<title>Basic HTML web page</title>
30+
<style>
31+
h3 {
32+
color: red;
33+
}
34+
</style>
35+
</head>
36+
<body>
37+
<h3>Hello world!</h3>
38+
</body>
39+
</html>
40+
```
41+
4142
</td>
4243
<td align="center">
4344
<h3>Hello world!</h3>
4445
</td>
4546
</tr>
46-
</table>
47+
</table>

‎docs/BasicReactComponent.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66
<td>
77

88
```js
9-
import React from 'react';
9+
import React from 'react'
1010

1111
const App = () => {
1212
return <h1>Hello World!</h1> // HTML like JSX syntax
1313
}
1414

15-
export default App;
15+
export default App
1616
```
17+
1718
</td>
1819
</tr>
19-
</table>
20+
</table>

‎docs/JSvsTS.md‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
<td>
1313

1414
```js
15-
const squareOfNumber = (num) => {
16-
console.log(num * num);
15+
const squareOfNumber = num => {
16+
console.log(num * num)
1717
}
1818

1919
/**
@@ -22,19 +22,18 @@ const squareOfNumber = (num) => {
2222
* Valid JavaScript syntax
2323
*/
2424

25-
squareOfNumber("incorrect data type");
26-
squareOfNumber(true);
27-
squareOfNumber([]);
28-
squareOfNumber(1);
29-
30-
25+
squareOfNumber('incorrect data type')
26+
squareOfNumber(true)
27+
squareOfNumber([])
28+
squareOfNumber(1)
3129
```
30+
3231
</td>
3332
<td>
3433

3534
```ts
3635
const squareOfNumber = (num: number): void => {
37-
console.log(num * num);
36+
console.log(num * num)
3837
}
3938

4039
/**
@@ -43,13 +42,14 @@ const squareOfNumber = (num: number): void => {
4342
* Invalid TypeScript syntax
4443
*/
4544

46-
squareOfNumber("incorrect data type");
47-
squareOfNumber(true);
48-
squareOfNumber([]);
45+
squareOfNumber('incorrect data type')
46+
squareOfNumber(true)
47+
squareOfNumber([])
4948

5049
// Only valid TypeScript syntax
51-
squareOfNumber(1);
50+
squareOfNumber(1)
5251
```
52+
5353
</td>
5454
</tr>
55-
</table>
55+
</table>

‎docs/ReactLifecycle.md‎

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,16 @@
1818
componentDidMount() {
1919
}
2020
```
21-
21+
2222
</td>
2323
<td>
2424

2525
```js
2626
useEffect(() => {
2727
// runs on mount (only once)
28-
},[])
28+
},[])
2929
```
30+
3031
</td>
3132
</tr>
3233

@@ -40,6 +41,7 @@ useEffect(() => {
4041
componentDidUpdate() {
4142
}
4243
```
44+
4345
</td>
4446
<td>
4547

@@ -52,8 +54,9 @@ useEffect(() => {
5254
```js
5355
useEffect(() => {
5456
// runs if any dependency changes
55-
},[dependencies])
57+
},[dependencies])
5658
```
59+
5760
</td>
5861
</tr>
5962

@@ -65,12 +68,12 @@ useEffect(() => {
6568
shouldComponentUpdate() {
6669
}
6770
```
71+
6872
</td>
6973
<td>
7074

7175
```js
72-
React.memo(Component,
73-
(prevProps, nextProps) => {
76+
React.memo(Component, (prevProps, nextProps) => {
7477
/**
7578
* compares previous and next props
7679
* returns false if they are not same
@@ -83,7 +86,6 @@ React.memo(Component,
8386
</td>
8487
</tr>
8588

86-
8789
<tr></tr>
8890

8991
<tr>
@@ -94,6 +96,7 @@ React.memo(Component,
9496
componentWillUnmount() {
9597
}
9698
```
99+
97100
</td>
98101
<td>
99102

@@ -104,6 +107,7 @@ useEffect(() => {
104107
}
105108
})
106109
```
110+
107111
</td>
108112
</tr>
109-
</table>
113+
</table>

‎src/App.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const App: React.FC = () => {
2121
<Route exact path='/' component={Home} />
2222
</Switch>
2323
</Router>
24-
</div>
24+
</div>
2525
)
2626
}
2727

‎src/algorithms/QuickSort.ts‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,13 @@ export default class QuickSort implements IAlgorithm {
2020
public sort(arr: Bar[]): Bar[][] {
2121
this.steps = new Steps(arr)
2222
this.quickSort(this.steps.getLastStep(), 0, arr.length - 1)
23-
return [...this.steps.getSteps(), this.steps.getLastStep().map(i => {
24-
i.status = BarStatus.SORTED
25-
return i
26-
})]
23+
return [
24+
...this.steps.getSteps(),
25+
this.steps.getLastStep().map(i => {
26+
i.status = BarStatus.SORTED
27+
return i
28+
})
29+
]
2730
}
2831

2932
private quickSort(items: Bar[], left: number, right: number) {

‎src/components/Algorithms/contents/Algorithm.tsx‎

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,38 @@ const Algorithm: React.FC = () => {
55
<>
66
<p>
77
Algorithm can be defined as a set of steps to accomplish a given task.
8-
Its purpose is to make is easier to replicate doing the task again and be efficient and accurate to the same degree.
9-
The term ‘Algorithm’ is derived from the name of 9th century Persian sci-entist, astronomer,
10-
and mathematician Abdullah Muhammad bin Musa al-Khwarizimi who is also regarded as
11-
‘The father of Algebra’.
8+
Its purpose is to make is easier to replicate doing the task again and
9+
be efficient and accurate to the same degree. The term ‘Algorithm’ is
10+
derived from the name of 9th century Persian sci-entist, astronomer, and
11+
mathematician Abdullah Muhammad bin Musa al-Khwarizimi who is also
12+
regarded as ‘The father of Algebra’.
1213
</p>
1314
<br />
1415
<p>
15-
Algorithm can be found everywhere in day-to-day life.
16-
The primitive form of algorithm began with calculating and at the present time,
17-
it is being used in complex study and operation such as artificial intelligence,
18-
computer processing, gaming, molecular biology, and various other scientific research areas.
19-
It can be as simple as steps to turn on and off a light switch to any mathematical or computational operations.
20-
It is used primarily for calculation, data processing, and automated reasoning.The importance of algorithm arises once quality and efficiency are key factors to be considered while accomplishing any tasks.
21-
Opposite of following an algorithmic process is performing the same task, each time in different and unique manner.
22-
This introduces unreliability, inefficiency and increases time, energy, cost, and many other factors.
23-
Thus, use of algorithm helps eliminate these hurdles, brings consistency, efficiency and quality which is visible as the result.
16+
Algorithm can be found everywhere in day-to-day life. The primitive form
17+
of algorithm began with calculating and at the present time, it is being
18+
used in complex study and operation such as artificial intelligence,
19+
computer processing, gaming, molecular biology, and various other
20+
scientific research areas. It can be as simple as steps to turn on and
21+
off a light switch to any mathematical or computational operations. It
22+
is used primarily for calculation, data processing, and automated
23+
reasoning.The importance of algorithm arises once quality and efficiency
24+
are key factors to be considered while accomplishing any tasks. Opposite
25+
of following an algorithmic process is performing the same task, each
26+
time in different and unique manner. This introduces unreliability,
27+
inefficiency and increases time, energy, cost, and many other factors.
28+
Thus, use of algorithm helps eliminate these hurdles, brings
29+
consistency, efficiency and quality which is visible as the result.
2430
</p>
2531
<br />
2632
<p>
27-
Algorithm is related to function and sometimes they are even used interchangeably but they are still not same.
28-
While an algorithm is a set of ideas or an abstract concept that elaborates on how to solve a problem,
29-
and functions are the actual implementation of the algorithm which can be used to solve them.
30-
Hence, a function can be an implementation of a whole algorithm or a single or multiple steps of an algorithm.
33+
Algorithm is related to function and sometimes they are even used
34+
interchangeably but they are still not same. While an algorithm is a set
35+
of ideas or an abstract concept that elaborates on how to solve a
36+
problem, and functions are the actual implementation of the algorithm
37+
which can be used to solve them. Hence, a function can be an
38+
implementation of a whole algorithm or a single or multiple steps of an
39+
algorithm.
3140
</p>
3241
</>
3342
)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /