自然排序算法的实现困境

编程入门 行业动态 更新时间:2024-10-27 18:32:53
本文介绍了自然排序算法的实现困境的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我用Google搜索ASP经典的自然排序算法无济于事的实现。最好我能找到的是从戴夫Koelle ,这是从SO一个问题。问题是,因为我需要实现这个算法在ASP经典,我没有使用某些功能,如

I have Googled ASP Classic implementations of the natural sort algorithm to no avail. Best I was able to find was from Dave Koelle, which was from a question on SO. Issue is that since I need to implement this algorithm in ASP Classic, I don't have access to certain functions such as

Col​​lections.sort(你的名单,新AlphanumComparator());

在理想情况下,我想一个数组传递给一个函数,并将它返回到我的有序排列。

Ideally, I'd like to pass an array to a function and have it return to me the ordered array.

任何想法,我能做什么?

Any ideas as to what I could do?

感谢你。

推荐答案

您还没有哪一种语言,你在ASP中使用指定的。通常情况下,这将是VBScript中。

You haven't specified which language you are using in ASP. Typically this would be VBScript.

不过,如果你使用JScript的,而不是那么你可以使用JScript中的数组对象,并使用它的排序方法。该方法任选地作为一个参数的比较器功能。

However if you were to use JScript instead then you can use JScript's array object and use its sort method. This method optionally takes as a parameter a comparator function.

var a = new Array(); // code to populate array a.sort(function() { // Comparator code returning (-1|0|1) });

有没有需要的一切转换为JScript中,你可以用用JScript公用事业从VBScript。

There is no need to convert everything to JScript, you can use utilities written in JScript from VBScript.

更多推荐

自然排序算法的实现困境

本文发布于:2023-11-29 01:09:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1644683.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:算法   困境   自然

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!