有序集合和排序集合有什么区别? [英] What is the difference between an ordered and a sorted collection?

查看:27
本文介绍了有序集合和排序集合有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

sortedordered 集合之间有什么区别吗?

Is there any difference between a sorted and an ordered collection?

推荐答案

有序集合 意味着集合的元素具有特定的顺序.顺序与值无关.List 就是一个例子.

An ordered collection means that the elements of the collection have a specific order. The order is independent of the value. A List is an example.

有序集合意味着集合不仅有顺序,而且顺序取决于元素的值.SortedSet 就是一个例子.

A sorted collection means that not only does the collection have order, but the order depends on the value of the element. A SortedSet is an example.

相比之下,没有任何顺序的集合可以以任何顺序维护元素.Set 就是一个例子.

In contrast, a collection without any order can maintain the elements in any order. A Set is an example.

这篇关于有序集合和排序集合有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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