直观地执行不同的排序算法
几种不同排序算法的可视化效果如何?我正在寻找可以在演示中使用的东西,并且愿意编写自己的东西(不会那么难),但如果可以的话,我更愿意使用别人的。
不过,没有小程序,我发现的大多数都是小程序......轻量级闪存或画布。我想要以下排序:
- 气泡
- 选择
- 插入
- O/E
不错,但不需要:
- 合并
- 快速
- 堆
- Raidix
考虑到缺乏可用的,我 我自己写了来回答这个问题。
Any decent visualization of a couple different sort algorithms? I'm looking for something I can use in a demo, and willing to write my own (can't be that hard) but would prefer to use someone else's if I can.
NO applets though, the majority I'm finding are applets... Lightweight flash or canvas. I would like the following sorts:
- Bubble
- Selection
- Insertion
- O/E
Nice but not needed:
- Merge
- Quick
- Heap
- Raidix
Considering the lack of available ones, I wrote my own to answer this question.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
我不喜欢任何可用的,所以 我自己编写了 不那么简短的解释来配合它。
实现的排序:
选项
数据集:
我已尽力确保时差尽可能准确,如果您有任何改进建议,请告诉我。
I didn't like any of the ones available, so I wrote my own with a not-so-brief explanation to go along with it.
Sorts implemented:
Options
Data sets:
I've tried to make sure the time differences are as accurate as possible, please let me know if you have any suggestions for improvement.
这里的可视化效果非常好,它们似乎只是 gif
http://www.sorting-algorithms.com/< /a>
The visualizations here are pretty good, they seem to be just gifs
http://www.sorting-algorithms.com/
这是一个很棒的视频。不仅仅是可视化:
http://www.youtube.com/watch?v=t8g -iYGHpEA
This is a great video. More than just a visualization:
http://www.youtube.com/watch?v=t8g-iYGHpEA
我认为这个网站非常棒,有几种不同的绘图类型显示了不同算法的工作原理。还包括每个排序算法的 python 实现。
I thought this site was fantastic, there's a few different plot types showing how the different algorithms work. A python implementation of each sorting algorithm is included as well.
Sorting Out Sorting 是该主题的经典作品;如果你用谷歌搜索这个短语,第一个点击的将是一个完整的视频。质量看起来有点模糊,因为计算机视频看起来像是根据 16 毫米印刷品的视频副本而不是母版制作的(我不知道母版是否仍然存在),但无论如何它可能是一个很好的介绍。我很高兴看到它可用。
Sorting Out Sorting is the classic work on the subject; if you Google the phrase, one of the first hits will be a full-length video. The quality looks a little fuzzy, since the computer video looks like it was made off a video copy of a 16mm print rather than the master (I have no idea if the master still exists) but it's probably a good introduction anyway. I'm glad to see it's available.
经典的可视化是电影排序。
The classic visualization is the movie Sorting out sorting.
我只是准确地写了您正在寻找的内容(我认为),并针对这个问题。您可以在以下位置找到它:http://visualsort.appspot.com/。它允许您编写代码(在 CoffeeScript 中),然后显示发生的情况。有一些内置类型,如果人们向我发送代码或提出特定请求,我愿意添加更多类型
I just wrote exactly what you were looking for (I think), and was directed to this question. You can find it at: http://visualsort.appspot.com/. It allows you to write code (in CoffeeScript) and then shows what happens. There are a few built-in sorts, and I would be willing to add more if people send me code or make specific requests