sort-view
v1.0.7
Published
Different types of sort with visual representation
Downloads
24
Maintainers
Readme
sort-view
Different types of sort with visual representation
Installation
npm install sort-view
Sorting algorithms can be complex to understand merely by looking at their code. Visualizations in command-prompt provide a graphical representation of how the algorithm works step by step, making it easier to understand the underlying logic and behavior.
Key points to remember while using visualization
Note: The above points are valid only in case of visualization. If there is no need of visualization then any length of numeric array will be sorted and returned.
Available methods:
bubblesort(array, view = boolean) This function takes 2 arguments where the view argument is optional to view how the sort is working at each step. The first argument is an array. The function sorts the original array using bubblesort and returns it.
insertionsort(array, view = boolean) This function takes 2 arguments where the view argument is optional to view how the sort is working at each step. The first argument is an array. The function sorts the original array using insertionsort and returns it.
selectionsort(array, view = boolean) This function takes 2 arguments where the view argument is optional to view how the sort is working at each step. The first argument is an array. The function sorts the original array using selectionsort and returns it.