• Stars
    star
    285
  • Rank 145,115 (Top 3 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The Sound of Sorting: Visualize and Audibilize 12 classic sorting algorithms in real time

Sorting Visualization and Audibilization

Latest Update2 (05/04/2019)

  • Great News: Now we can get the Voice of Sorting Algorithm simultaneously, and this is so funny that we should all have a try!!!

Latest Update

  • Add three more sorting algorithms: CombSort, RadixSort, MonkeySort
  • Now you can record the whole sorting procedure to *avi videos.
  • Adding -r in command line can get you Re-sampled data.
  • Adding -s in command line can get you Sparse data.

Introduction

This repository is a demo of visualizing 12 types of Sorting Algorithms. It aims to make Sorting Algorithms easier for programmers to understand. Also, you can see the difference of Time Complexity between different sorting algorithms.

Sorting Algorithm AverageTime Complexity Bad Time Complexity Stability
Bubble Sort O(N^2) O(N^2) YES
Insertion Sort O(N^2) O(N^2) YES
Shell Sort O(N^5/4) O(N^2) NO
Selection Sort O(N^2) O(n^2) NO
Heap Sort O(NlogN) O(NlogN) NO
Merge Sort O(NlogN) O(NlogN) YES
Quick Sort O(NlogN) O(N^2) NO
Bucket Sort O(N) O(N) YES
Cycle Sort O(N) O(N^2) NO
Comb Sort O(N^2) O(N^2) NO
Radix Sort O(N) O(N) YES
Monkey Sort O(N!) O(N!) YES

Demos

Dependencies

  • python3.x
  • cv2
  • numpy
  • pygame

Quick Start

  1. Check all dependencies installed

    This command can help you install all the dependent packages

    pip install -r requirements.txt

  2. Clone this repository

    git clone [email protected]:ZQPei/Sort_Visualization.git

  3. Start

    python main.py -l 512 -t BubbleSort

    • -l --length: Array Length
    • -t --sort-type: Sorting Type. Default type is BubbleSort
      • BubbleSort
      • InsertionSort
      • ShellSort
      • SelectionSort
      • HeapSort
      • MergeSort
      • QuickSort
      • BucketSort
      • CycleSort
      • CombSort
      • RadixSort(LSD)
      • MonkeySort
    • -i --interval: Time Interval of next frame
    • -r --resample: Get Resampled Array
    • -s --sparse: Sparse Array
    • -n --no-record: Don't record to *.avi video!
    • --silent: No voice output
    • --sound-interval: Time of sound

May you have fun!

More Repositories

1

deep_sort_pytorch

MOT using deepsort and yolov3 with pytorch
Python
2,679
star
2

DSSD

Pytorch implementation of DSSD (Deconvolutional Single Shot Detector)
Python
54
star
3

patchmatch_inpainting

Implementation of PatchMatch for image inpainting in cpp
C++
48
star
4

Seeded-Region-Growing-Algorithm

Seeded Region Growing Algorithm
Python
24
star
5

Haze_Removal_cpp

An c++ implementation of 《single image haze removal using dark channel prior》
C++
11
star
6

Haze_Removal_python

This is an python implementation of "single image haze removal using dark channel prior"
Python
9
star
7

ASCII-Art

把图片/电影转成字符画
Python
9
star
8

deep_joint_filter

This is an pytorch implementation of Deep Joint Filter
Python
8
star
9

transfer_learning_resnet18

基于resnet18的迁移学习分类网络,用于给bee和ant二分类
Python
7
star
10

Huster

HTTP Server with Upload tool.
Python
4
star
11

Maze

maze, dfs, 深度优先搜索
Python
4
star
12

image2html

Showing images with a html file
Python
3
star
13

AirCraft

A small game AirCraft
C
2
star
14

pybind11_cpp_python

cpp call python, or python call cpp, hybrid programming using pybind11, with and without numpy
C++
2
star
15

easyyaml

Easy yaml parser and editer
Python
2
star
16

MNIST_logistic_regression

用逻辑回归实现对手写字符的分类
Python
2
star
17

cuda_sort

1
star
18

Lenet_cifar10_pytorch

It is a Lenet CNN trained on cifar10 using pytorch
Python
1
star
19

awesome-mechine-learning-systems

1
star
20

docker_pytorch_tensorflow

This repository contains a Dockerfile for an anaconda environment with pytorch and tensorflow installed as well as oh-my-zsh, tmux and etc.
Dockerfile
1
star
21

Alibaba_Cloud_German_AI_Challenge_for_Earth_Observation

Alibaba Cloud German AI Challenge 2018, 1st Prize.
Python
1
star
22

pingan_algo_challenge

2018平安算法比赛代码分享
Python
1
star