# sort_sf

> sort apriori

Latest version **1.0.1** (published 2017-01-23) · ISC license · 0 weekly downloads

## Install

```sh
npm install sort_sf
pnpm add sort_sf
yarn add sort_sf
bun add sort_sf
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2017-01-23 |
| First published | 2017-01-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | soonfy |
| Maintainers | soonfy |
| Keywords | sort |

## Links

- npm: https://www.npmjs.com/package/sort_sf
- Repository: https://github.com/soonfy/soonfy_sort
- Homepage: https://github.com/soonfy/soonfy_sort#readme
- Issues: https://github.com/soonfy/soonfy_sort/issues
- npm.io page: https://npm.io/package/sort_sf

## Recent versions

- 1.0.1 (latest) — 2017-01-23
- 1.0.0 — 2017-01-23

## README

# sort  

## ready  

  1. typescript  
  > build and run  
  > config typescript  
  > tsc -w  

  2. ts-node  
  > run  

  ```
  ts-node *.ts
  ```

## apriori  
> summary  

![apriori summary](./images/summary.png)  
> 参数：n - 数据规模，k - 桶的个数，in-place：常用内存，out-place - 额外内存。  

1. bubble sort  
![bubble sort](./images/bubble.gif)  
  * 原理  
  > 依次比较相邻的两个数，如果不符合排序规则，则调换两个数的位置。这样一遍比较下来，能够保证最大（或最小）的数排在最后一位。  
  > 再对最后一位以外的数组，重复前面的过程，直至全部排序完成。  

  * 特殊情况  
  > 最好 - 数组是正序。  
  > 最坏 - 数组是反序。  

  * 总结  
  > 最易懂的排序算法，但是效率较低。

2. selection sort  
![selection sort](./images/selection.gif)  
  * 原理  
  > 依次对相邻的数进行两两比较，不是每比较一次就调换位置，而是一轮比较完毕，找到最大值（或最小值）之后，将其放在正确的位置，其他数的位置不变。
  > 再对最后一位以外的数组，重复前面的过程，直至全部排序完成。  

  * 特殊情况  
  > 最好 -  
  > 最坏 -

---
_Source: https://npm.io/package/sort_sf · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
