Code Monkey home page Code Monkey logo

sorting-algorithm-visualizer's Introduction

Sorting algorithm visualizer

Visualizing sorting algorithms, using the matplotlib library.

Algorithms covered so far:

Name Function Name
Quick Sort quick_sort
Bubble Sort bubble_sort
Selection Sort selection_sort
Insertion Sort insertion_sort
Heap Sort heap_sort
Merge Sort merge_sort

Usage:

Install

pip install -r requirements.txt

Run

python main.py function_name

Pass function name as a command line argument from list of functions above (in all lower case and spaces replaced by underscore).

For example:

python main.py quick_sort

How to contribute

If you want to add a new sorting algorithm:

  1. Code the algorithm in sorting.py.
  2. Name the function appropriately, like quick_sort, bubble_sort.
  3. While coding the function, do not use python lists. Instead, use an Array object. The Array class is defined in sorting.py. (See already implemented algorithms, for your reference)
  4. The Array object has swap, set, get_len, get methods implemented. Feel free to implement any more, additional methods, that you may see fit.
  5. Make sure you add the sorting algorithm to the Readme file!
  6. Make sure your newly implemented algorithm works, by running test.py after appending it to the list of algorithms in test.py.

sorting-algorithm-visualizer's People

Contributors

test123 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.