直观地执行不同的排序算法

发布于 2024-09-25 04:05:00 字数 426 浏览 4 评论 0原文

几种不同排序算法的可视化效果如何?我正在寻找可以在演示中使用的东西,并且愿意编写自己的东西(不会那么难),但如果可以的话,我更愿意使用别人的。

不过,没有小程序,我发现的大多数都是小程序......轻量级闪存或画布。我想要以下排序:

  • 气泡
  • 选择
  • 插入
  • 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

似狗非友 2024-10-02 04:05:00

我不喜欢任何可用的,所以 我自己编写了 不那么简短的解释来配合它。

实现的排序:

  • 气泡
  • 选择
  • 插入
  • 梳(有两个交替的结尾)
  • Shell
  • 快速
  • O/E
  • 基数

选项

  • 随机 部分
  • 排序
  • 反转
  • 少量值

数据集:

  • 大(约 250 个元素)
  • 小(约 50 个元素,适用于速度较慢的浏览器,并且在移动设备,如 iPhone 或 iPod touch)

我已尽力确保时差尽可能准确,如果您有任何改进建议,请告诉我。

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:

  • Bubble
  • Selection
  • Insertion
  • Comb (with two alternate endings)
  • Shell
  • Quick
  • Heap
  • O/E
  • Radix

Options

  • Random
  • Partially sorted
  • Reversed
  • Few values

Data sets:

  • Large (~250 elements)
  • Small (~50 elements, works well for slower browsers and excellent on mobile devices such as an iPhone or iPod touch)

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.

星光不落少年眉 2024-10-02 04:05:00

这里的可视化效果非常好,它们似乎只是 gif

http://www.sorting-algorithms.com/< /a>

The visualizations here are pretty good, they seem to be just gifs

http://www.sorting-algorithms.com/

↘紸啶 2024-10-02 04:05:00

这是一个很棒的视频。不仅仅是可视化:

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

温柔戏命师 2024-10-02 04:05:00

我认为这个网站非常棒,有几种不同的绘图类型显示了不同算法的工作原理。还包括每个排序算法的 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.

晚风撩人 2024-10-02 04:05:00

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.

时光倒影 2024-10-02 04:05:00

经典的可视化是电影排序

The classic visualization is the movie Sorting out sorting.

东京女 2024-10-02 04:05:00

我只是准确地写了您正在寻找的内容(我认为),并针对这个问题。您可以在以下位置找到它: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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文