Skip to main content

Python package to visualize any sorting algorithm

Project description

Sort_visualizer

Sort_visualizer is a tool that will allow you to easily visualize any sorting algorithms

Usage

In order to visualize your own sort you need to create a class that inherits from algs.Sort and implement execute(self) method.

To access array use self.array.

Every object in self.array is a Rectangle class instance. To access associated value use .height attribute.

Visual functions:

  • When an element changed its value use self.redraw()
  • When swapping two elements of the array use self.swap_rects(rect1: Rectangle, rect2: Rectangle)

(Please note that swap_rects function only applies visual part, you still need to actually swap the values in array)

In test.py you can find example of creating your own algorithm and actually run python test.py to see how it works.

To see more examples check sort_visualizer/algs.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sort_visualizer-1.0.4.tar.gz (5.5 kB view details)

Uploaded Source

File details

Details for the file sort_visualizer-1.0.4.tar.gz.

File metadata

  • Download URL: sort_visualizer-1.0.4.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.2

File hashes

Hashes for sort_visualizer-1.0.4.tar.gz
Algorithm Hash digest
SHA256 ebdb8c1c85b108de080ab3d5d26b8b5edfe3527750f13fd52639723962130bdb
MD5 ad8d18407d34f9d611082b816dc56cd6
BLAKE2b-256 cc354226af14c542357082cf7e706005cb1b59ab4e4a221c6a970c952fca0282

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page