Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/luke-zhang-04/sorting-algorithms
Sorting algorithms in Python 3, Golang, TypeScript 3, and C++ 11
https://github.com/luke-zhang-04/sorting-algorithms
cpp golang javascript python3 sorting-algorithms typescript
Last synced: about 2 months ago
JSON representation
Sorting algorithms in Python 3, Golang, TypeScript 3, and C++ 11
- Host: GitHub
- URL: https://github.com/luke-zhang-04/sorting-algorithms
- Owner: Luke-zhang-04
- License: other
- Created: 2019-12-21T17:19:21.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-08-17T17:12:24.000Z (over 4 years ago)
- Last Synced: 2024-10-12T09:40:53.122Z (3 months ago)
- Topics: cpp, golang, javascript, python3, sorting-algorithms, typescript
- Language: Python
- Homepage:
- Size: 356 KB
- Stars: 1
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Sorting Algorithms #
A collection of sorting algorithms in Python 3, Golang, TypeScript, and C++. Algorithms range from bogo sort to bubble sort to merge sort. I also use tkinter to animate the algorithms with bar graphs.## How to run ##
### Python ###
#### Animated ####
##### Install dependencies #####
```bash
pip install -r requirements.txt
```
##### Run Program #####
```bash
python3 . animated
```
#### Normal ####
```bash
python3 .
```
E.g
```bash
python3 . bogoSort bubbleSort
```### Node JS ###
#### Install dependencies ####
With Yarn:
```bash
yarn --frozen-lockfile
```
With NPM:
```bash
npm ci
```
### Build ###
With Yarn:
```bash
yarn build
```
With NPM:
```bash
npm run build
```#### Run Program ####
For all options, run
```bash
node . --help
```
```bash
Options:
-bogo, --bogoSort Run bogo sort algorithm
-bubble, --bubbleSort Run bubble sort algorithm
-cocktail, --cocktailShakerSort Run cocktail shaker sort algorithm
-comb, --combSort Run comb sort algorithm
-counting, --countingSort Run counting sort algorithm
-gnome, --gnomeSort Run gnome sort algorithm
-insertion, --insertionSort Run insertion sort algorithm
-merge, --mergeSort Run merge sort algorithm
-mergeIP, --mergeSortInPlace Run in-place merge sort algorithm
-quick, --quickSort Run quickSort sort algorithm
-lsd, --radixLSD Run radix sort least significant digit algorithm
-msd, --radixMSD Run raidx sort most significant digit algorithm
-shell, --shellSort Run raidx sort algorithm
-tim, --timSort Run tim sort algorithm
-h, --help display help for command
```
Example:
```bash
node . -bogo --bubbleSort
```### Go ###
#### Run directly
```bash
go run main.go
```
```bash
go run main.go bogo bubbleSort
```
#### Compile first ####
##### Build/compile #####
```bash
go build main.go
```
##### Run/execute #####
```bash
./main
```
E.g
```bash
go build main.go
./main bogo bubbleSort
```### C++ ###
#### Build/compile ####
```bash
make
```
#### Run/execute ####
```bash
./bin
```
```bash
./bin bogo bubbleSort
```
E.g
```bash
make
./bin bogo bubbleSort
```