排序依据和OrderByDescending是稳定的? [英] OrderBy and OrderByDescending are stable?

查看:256
本文介绍了排序依据和OrderByDescending是稳定的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在读临LINQ的C#2008,并在第87页的家伙说排序依据和OrderByDescending是稳定的。但是他说,正好相反在第96页在我看来,他指的是完全一样的功能,所以我不明白这一点。他们是稳定与否?

I am currently reading Pro LINQ c# 2008, and in page 87 the guy says OrderBy and OrderByDescending are stable. But he says exactly the opposite in page 96. It looks to me as he is referring to exactly the same functions, so I don't get it. Are they stable or not?

推荐答案

是的,他们是绝对稳定。我在<一拿起同样的错误href="http://msmvps.com/blogs/jon%5Fskeet/archive/2008/09/22/book-review-pro-linq-language-integrated-query-in-c-2008-by-joe-rattz.aspx">my回顾书。

Yes, they're definitely stable. I picked up the same error in my review of the book.

乔回应了这个,我的审查一下:

Joe responded to that bit of my review with this:

只是为你的读者的认识,   排序现在指定为   稳定。最初它是不稳定的,   后来改为稳定,但我   被告知将被指定为   不稳定的,但显然一些   点,该规范被改变   是稳定的。我的书进行了更新,但   显然我错过了一个点。

Just for your reader's knowledge, the ordering is now specified to be stable. Initially it was unstable, and was later changed to be stable but I was told it would be specified to be unstable, but apparently at some point, the specification was changed to be stable. My book was updated but apparently I missed a spot.

所以,是的,这是一个错误。

So yes, it was a mistake.

总的来说这是一个相当准确的书。 (有一些不准确这是由于MSDN是不准确的,但这很容易原谅。)还有的的糟糕围绕:)

Overall it's a reasonably accurate book. (There are a few inaccuracies which are due to MSDN being inaccurate, but that's fairly easy to forgive.) There are far worse around :)

这篇关于排序依据和OrderByDescending是稳定的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆