Sorting algorithms visualizer
sorting-algorithms.com
Sorting algorithms visualizer
1–10 of 41 posts
Re: Sorting algorithms visualizer
#2- Stable: Equal keys aren't reordered.
- Operates in place, requiring O(1) extra space.
- Worst-case O(n·lg(n)) key comparisons.
- Worst-case O(n) swaps.
- Adaptive: Speeds up to O(n) when data is nearly sorted or when there are few unique keys.
There is no algorithm that has all of these properties, and so the choice of sorting algorithm depends on the application."
Is there any formal proof that such an algorithm doesn't exist? Are some of those criterion mutually exclusive?
Re: Sorting algorithms visualizer
#3Re: Sorting algorithms visualizer
#4Re: Sorting algorithms visualizer
#5I once wrote a generic algorithm visualizer where you write your own algorithm, and a view function. Then the framework records the state of the algorithm as it changes and passes it to the view function. Then you can play the states like you play a video, go back and forth etc. Here is an example with bubble-sort: http://awal.js.org/alpg/?gist=8b5c6679edc3b85106fb (hit run, then play/rewind/etc.)
The source is available at https://github.com/awalGarg/alpg if anyone feels like dabbling in.
Re: Sorting algorithms visualizer
#6"The ideal sorting algorithm would have the following properties: - Stable: Equal keys aren't reordered. - Operates in place, requiring O(1) extra space. - Worst-case O(n·lg(n)) key comparisons. - Worst-case O(n) swaps. - Adaptive: Speeds up to O(n) when data is nearly sorted or when there are few unique keys. There is no algorithm that has all of these properties, and so the choice of sorting algorithm depends on th…
- Operates in place, requiring O(1) extra space.
- Worst-case O(n·lg(n)) key comparisons.
- Worst-case O(n) swaps.
I don't have a formal proof, but I believe one should be possible.Re: Sorting algorithms visualizer
#7To be honest the 3D model doesn't really confer a greater understanding of the algorithm as hoped, but it's nice to play with.
Re: Sorting algorithms visualizer
#8Re: Sorting algorithms visualizer
#9It would be even nicer if there was some way to find out who made it and/or how to contact the author(s); and/or how and whether one can add more algorithms (e.g. I'd love to see timsort and introsort).
As it is, this site seems to be completly anonymous. Which is of course a valid choice by the author(s), but IMHO quite sad :-(.
Re: Sorting algorithms visualizer
#10This is a really nice page! It would be even nicer if there was some way to find out who made it and/or how to contact the author(s); and/or how and whether one can add more algorithms (e.g. I'd love to see timsort and introsort). As it is, this site seems to be completly anonymous. Which is of course a valid choice by the author(s), but IMHO quite sad :-(.