Skip to content

Commit aa8847b

Browse files
committed
add docs for bogosort
1 parent b43a3b5 commit aa8847b

File tree

3 files changed

+46
-19
lines changed

3 files changed

+46
-19
lines changed

changelog.md

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
1-
<div align="left">
2-
<h1><img src="https://cdn.abranhe.com/projects/algorithms/algorithms.svg" alt="Algorithms" height="30px">
3-
<img src="https://cdn.abranhe.com/projects/algorithms/logos/javascript.svg" width="30px">
4-
Changelog
5-
</h1>
6-
<div>
1+
n.n.n / 2019-02-21
2+
==================
73

8-
# `0.0.2`
4+
* Merge pull request #2 from christianbender/add_bogo_sort
95

10-
- Fix installing issue
6+
* changed according to xo-tool
7+
* added bogo sort
8+
* package.json
9+
* Merge pull request #1 from abranhe/donotdisturb
10+
* no more notifications
11+
* remove comma (,)
1112

12-
# `0.0.1`
13-
14-
Date: October 29, 2018
15-
16-
> Algorithms:
17-
18-
- **Sorting**
19-
- Bubble Sort
20-
- Merge Sort
13+
0.0.2 / 2018-10-29
14+
==================
15+
16+
* fix install issue && jump to 0.0.2
17+
* init

docs/sorting/bogo-sort.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Bogo Sort
2+
3+
In computer science, bogosort is a highly ineffective sorting function based on the generate and test paradigm. The function successively generates permutations of its input until it finds one that is sorted. It is not useful for sorting, but may be used for educational purposes, to contrast it with more efficient algorithms.
4+
5+
## Install
6+
7+
```
8+
npm install allalgorithms
9+
```
10+
11+
## Usage
12+
13+
```js
14+
const allalgorithms = require('allalgorithms');
15+
16+
arr = [77, 2, 10, -2, 1, 7]
17+
18+
console.log(allalgorithms.sorting.bogoSort(arr))
19+
// -> [-2, 1, 2, 7, 10, 77]
20+
```
21+
22+
## API
23+
24+
### bogoSort(array)
25+
26+
> Returns a sorted array
27+
28+
##### Params:
29+
30+
- `array`: Unsorted Array

src/sorting.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
2+
bogoSort: require('./sorting/bogo-sort'),
23
bubbleSort: require('./sorting/bubble-sort'),
3-
mergeSort: require('./sorting/merge-sort'),
4-
bogoSort: require('./sorting/bogo-sort')
4+
mergeSort: require('./sorting/merge-sort')
55
};

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy