VisualSort

Languages and libraries

sorting algorithm visualizer

SHOW HN2011

292points
80comments
#14of 1,097 in 2011
Top 2%of 2011 by points

How HN took it

CuriousMostly questions and neutral comments

9 positive, 29 neutral or asking, 1 mixed, 7 critical, out of 46 comments about the project. Thread score -0.01.

Idea: 3 for, 3 againstExecution: 2 for, 2 againstDesign: 1 for, 1 againstDocs: 1 for, 0 against

The thread, comment by comment

Each row is a top-level comment and its replies, in HN's order. Select a cell to open that comment on HN.

positive neutral or mixed critical about another commenter or something else the maker

What HN said

What people liked

  • Great for teaching sorting visually

    From 2 comments
    • This is fantastic for teaching sorting algorithms visually. I'm going to see if I can forward this to my former professors and teachers.
      oacgnol on HN
    • It's fantastic. I don't know CoffeeScript so all I did was compare the pre-written ones to each other and see if they did what I expected them to do, but it's a nice visual…
      jc4p on HN
  • Fun to write custom sorts

    From 2 comments
    • Yay. My first program in CoffeScript. It was fun to implement algorithm of which I only vaguely remembered how it worked. Details bit me few times before I got it working and…
      scotty79 on HN
    • Had fun writing a gnome-sort in a minute or two: ``` pos = 1 while pos < VA.length if (VA.gte(pos, pos-1)) pos++ else VA.swap(pos, pos-1) if (pos > 1) pos-- else pos++ ```
      SeoxyS on HN

Objections

  • Quicksort uses poor pivot choice

    From 2 comments
    • The quicksort implementation is incorrect. The code simply picking the left-most element as the pivot, and as a result it becomes pathologically slow for nearly-sorted array --…
      HardyLeung on HN
    • That's still a quicksort - it always has n^2 as its worst case I thought? If you pick the wrong pivot each time.
      cschneid on HN
  • Neon yellow color is painful to view

    From 1 comment
    • It's fantastic. I don't know CoffeeScript so all I did was compare the pre-written ones to each other and see if they did what I expected them to do, but it's a nice visual…
      jc4p on HN

Requests

  • Add cache and branch behaviour simulation

    From 2 comments
    • I love the stats on the side. Knowing how many comparisons and swaps occur really shows the complexity of the algorithms. And to segue into my own area of interest with sorting,…
      pbiggar on HN
    • Yeah, I can see that. A big problem is that the set sizes where cache effects start to come into effect are much larger than the sizes you're modelling. A level 1 cache is going…
      pbiggar on HN
  • Allow values outside 1..length and duplicates

    From 1 comment
    • Very neat, but here's a couple of additions I'd like to see: 1. Allow for the array to contain values outside of the range of [1..length]. Ideally, allow for duplicate values as…
      eridius on HN
  • Add shuffle function

    From 1 comment

Questions

  • How is stack size or memory measured?

    From 1 comment
    • This might be a dumb question, but can you add numbers about the size of the stack to the right-side statistics? I.e. How many variables and calls to functions are stored in…
      DrHankPym on HN
  • Why does nothing display on infinite loops?

    From 2 comments
    • >Nothing will display if there is an infinite loop. Did someone solve the halting problem while I wasn't looking?
      akavi on HN
    • I assume it just computes every step, and then displays them all.
      kingkilr on HN

Alternatives named

  • Sorting-algorithms.com visualizations

    From 1 comment
    • This is a good set of sorting visualisations too, presented more compactly (but not customisable): http://www.sorting-algorithms.com/
      rnm on HN
  • Corte.si sorting visualisations

    From 1 comment
    • Nice, though I think static visualizations illustrate the examples more quickly and are easier to compare: http://corte.si/posts/code/visualisingsorting/index.html I also love…
      mbostock on HN
  • Wikipedia sorting animations

    From 1 comment
    • Wikipedia has similar animations for some of its articles about sorting algorithms, e.g.: https://secure.wikimedia.org/wikipedia/en/wiki/Quicksort
      cpeterso on HN

Category, keywords, summaries and labels on this page were made by AI (Thread Reader v2) and not checked by hand. Each point links to the comments it came from.

Add a badge to your READMEShown on HackerShow
[![Shown on HackerShow](https://hackershow.org/badge.svg)](https://hackershow.org/show/3040157)