https://github.com/mvakili/all-sorts
Java implementation of commonly used sort functions
https://github.com/mvakili/all-sorts
algorithm bubble-sort insertion-sort java merge-sort quick-sort selection-sort shell-sort sort sorting-algorithms visualization
Last synced: 21 days ago
JSON representation
Java implementation of commonly used sort functions
- Host: GitHub
- URL: https://github.com/mvakili/all-sorts
- Owner: mvakili
- Created: 2020-06-24T17:15:51.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-25T04:46:43.000Z (over 5 years ago)
- Last Synced: 2025-02-16T11:29:45.653Z (8 months ago)
- Topics: algorithm, bubble-sort, insertion-sort, java, merge-sort, quick-sort, selection-sort, shell-sort, sort, sorting-algorithms, visualization
- Language: Java
- Homepage:
- Size: 1.63 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Java implementation of commonly used sort functions
This is the visual implementation of sorting algorithms.
this code covers the following algorithms:
- [Bubble Sort]( http://en.wikipedia.org/wiki/Bubble_sort)
- [Selection Sort]( https://en.wikipedia.org/wiki/Selection_sort)
- [Insertion Sort]( http://en.wikipedia.org/wiki/Insertion_sort)
- [Quick Sort]( http://en.wikipedia.org/wiki/Quicksort)
- [Merge Sort]( http://en.wikipedia.org/wiki/Merge_sort)
- [Shell Sort]( https://en.wikipedia.org/wiki/Shellsort)
The implementation generates random unsorted double array based on user input and generates output both for CLI :desktop_computer: and GUI :bar_chart: using java `StdDraw` library.
## How it works
First of all, you should compile `allSorts.java` file using this command:
```bash
> javac allSorts.java
```
And to run the app, just run the command below. it will give some help for usage:
```bash
> java allSorts
Help:
java allSort [Algorithm Name] [Count] {delay}
Algorithm Names:
bubble: Bubble Sort
selection: Selection Sort
insertion: Insertion Sort
quick: Quick Sort
merge: Merge Sort
shell: Shell Sort
Delay:
time for each compare to show graphics in Milisecond
```
## Demos
### Bubble Sort
```bash
> java bubble 20 100
```

### Selection Sort
```bash
> java selection 20 100
```

### Insertion Sort
```bash
> java insertion 20 100
```

### Quick Sort
```bash
> java quick 20 100
```

### Merge Sort
```bash
> java merge 20 100
```

### Shell Sort
```bash
> java shell 20 100
```
