根据对另一个列表进行排序所产生的隐含重新排序来对一个列表进行重新排序的过程是什么?

发布于 2024-10-16 11:36:05 字数 528 浏览 3 评论 0原文

我对任何特定的算法不感兴趣;我只是想知道这样做是否有一个我不知道的通用名称。

具体来说,假设我有 X = [42, 0, 99]Y = ["a", "b", "c"]。当我重新排序 Y 时,它的名称是什么,就像我必须重新排序 X 以使 X 成为一个排序列表,以 <代码>[“b”,“a”,“c”]?

重新排序本身怎么样,它是一种列表 - 即 [<2nd>, <1st>, <3rd>] - 它也有一个通用名称吗?

似乎这种操作会有一个我应该知道的名称,有自己的维基百科页面和所有内容(或 NIST 算法和数据结构词典中的条目:http://xw2k.nist.gov/dads/)。当有人回答这个问题时,我可能会觉得自己像个傻瓜。

I'm not interested in any particular algorithm; I just want to know if doing that has a common name that I'm just not aware of.

To be specific, say I have X = [42, 0, 99] and Y = ["a", "b", "c"]. What is it called when I reorder Y in the same way that I have to reorder X to make X a sorted list, winding up with ["b", "a", "c"]?

What about the reordering itself, which is kind of a list - i.e. [<2nd>, <1st>, <3rd>] - does that have a common name too?

It seems like that would be the kind of operation that would have a name that I should know, with its own Wikipedia page and everything (or an entry in the NIST's Dictionary of Algorithms and Data Structures: http://xw2k.nist.gov/dads/). I'm probably going to feel like a dummy when someone answer this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(4

迷你仙 2024-10-23 11:36:05

重新排序本身称为排列(参见旁注)

我不知道针对这种情况的特殊术语,但您可以说您正在应用对列表 X 进行排序的排列到列表 Y。

旁注:请注意“排列”一词可以指一组元素的特定顺序,例如有序列表 [3, 1, 2] 是数字 {1, 2, 3} 的排列,以及元素的重新排序(如转换本身),例如将有序列表 [3, 1, 2] 排列 为有序列表 [1, 2, 3]。

The reordering itself is called a permutation(see sidenote).

I am not aware of a special term for the situation, but you could say that you're applying the permutation that sorts the list X, to the list Y.

Sidenote: Note that the word "permutation" can refer to both a particular ordering of a group of elements, for instance with the ordered list [3, 1, 2] being a permutation of the numbers {1, 2, 3}, as well as a reordering of elements (as in, the transformation itself), for instance the one that permutes the ordered list [3, 1, 2] to the ordered list [1, 2, 3].

小霸王臭丫头 2024-10-23 11:36:05

我最常将其称为“索引排序”。 X 是用于对 Y 进行排序的索引。

I've mostly known it as an "indexed sort". X is the index you use to sort Y.

笑脸一如从前 2024-10-23 11:36:05

据我所知,没有针对这种特定情况的术语,但您对列表 X 和 Y 应用相同的转换,并且创建转换以将列表 X 转换为排序列表。

As far as I know, there is no term for this specific situation, but you are applying the same transformation to lists X and Y, and you create the transformation such that it transforms list X into a sorted list.

澉约 2024-10-23 11:36:05

您可以将其称为并行键排序,因为 X 包含排序键,Y 包含值。在函数式语言中,例如 Scala,这可以实现为 X.zip(Y).sortWith((a,b) => a._1 < b._1).map(a => a._2 )

You could call this a parallel key sort, since X contains the sort keys and Y contains the values. In a functional language, e.g., Scala, this could be implemented as X.zip(Y).sortWith((a,b) => a._1 < b._1).map(a => a._2)

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