Skip to main content

Show

This function is used to perform animations on any of the sorting algorithms.

Usage

Show(lst:list, callable:Callable, speed:float = 0.5, sortKey:Callable = lambda x:x)

Parameters:
      lst : List
            A list of elements to be sorted
      callable : Callable
            The sorting algorithm
      speed : float
            Animation speed
      sortKey : Callable
            Decides the relative ordering of elements

Example

from jellybeans.algos import bubble_sortfrom jellybeans.visualiser import ShowShow([9 ,1 ,5 ,28, 7], bubble_sort)