Skip to content

Visualizing several famous sorting algorithms via opencv-python

License

Notifications You must be signed in to change notification settings

DDCarry/Sorting_Visualization

Repository files navigation

Sorting Visualization

Introduction

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

Sorting AlgorithmTime Complexity
Bubble SortO(N^2)
Insertion SortO(N^2)
Shell SortO(NlogN)
Selection SortO(N^2)
Heap SortO(NlogN)
Merge SortO(NlogN)
Quick SortO(NlogN)
Bucket SortO(N)
Cycle SortO(N^2)

Dependencies

  • python3.x
  • cv2
  • numpy

Quick Start

  1. Check all dependencies installed

  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
    • -i--interval: Time Interval of next frame
    • -r--repetition: Array's Elements is Repeated or Not

May you have fun!

About

Visualizing several famous sorting algorithms via opencv-python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python100.0%