Skip to content

Senipah/vba-sorting-visualisation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

Visualising sorting algorithms in VBA

After recently changing my BetterArray project to use Timsort as the default sorting algorithm, I thought it would be fun to quickly throw together a file to visualise the difference between Timsort and the previous default Quicksort.

I also threw in a quick Bubble sort implementation to highlight just how inefficient it is in comparison.

Here's a video of them in action.

Timsort is slower in the video than Quicksort but in my testing Timsort was about the same if not marginally faster than Quicksort, depending on what is being sorted, so the difference in the video is likely related to how the chart is updated. Timsort is also a stable sort, which Quicksort is not.

The difference in speed between the Quicksort implementations and Bubble sort is roughly accurate though; they both use the same Swap method to update the chart. So yes, Bubble Sort really is that slow!

Here's a link to the Excel file this was done in if anyone wants to run it themselves.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published