Lesson: Algorithms
The polymorphic algorithms described here are pieces of reusable functionality provided by the Java platform. All of them come from the Collections
class, and all take the form of static methods whose first argument is the collection on which the operation is to be performed. The great majority of the algorithms provided by the Java platform operate on List
instances, but a few of them operate on arbitrary Collection
instances. This section briefly describes the following algorithms:
Sorting
The sort
algorithm reorders a List
so that its elements are in ascending order according to an ordering relationship. Two forms of the operation are provided. The simple form takes a List
and sorts it according to its elements' natural ordering. If you're unfamiliar with the concept of natural ordering, read the Object Ordering section.
The sort
operation uses a slightly optimized merge sort algorithm that is fast and stable:
-
Fast: It is guaranteed to run in
n log(n)
time and runs substantially faster on nearly sorted lists. Empirical tests showed it to be as fast as a highly optimized quicksort. A quicksort is generally considered to be faster than a merge sort but isn't stable and doesn't guarantee n log(n)
performance.
-
Stable: It doesn't reorder equal elements. This is important if you sort the same list repeatedly on different attributes. If a user of a mail program sorts the inbox by mailing date and then sorts it by sender, the user naturally expects that the now-contiguous list of messages from a given sender will (still) be sorted by mailing date. This is guaranteed only if the second sort was stable.
http://docs.oracle.com/javase/tutorial/collections/algorithms/index.html
分享到:
相关推荐
这个是英文原版,2011的,是最经典的,和网上的两页一起pdf不一样! Computer Vision: Algorithms and Applications 2011 你值得拥有
Computer Vision: Algorithms and Applications © 2010 Richard Szeliski 来自官网:http://szeliski.org/Book/ 以及官网的下载链接(September 3, 2010):...
Stefano大牛的经典ppt,关于3D stereo讲的很透彻很详细。对于学习Stereo的学者来说是必读的材料。希望能有所帮助。
Stereo Vision:Algorithms and Applications
经典统计学图书:Cambridge University Press, 2016 ...Algorithms, Evidence, and Data Science Bradley Efron Trevor Hastie ISBN: 978-1107149892 --------------------------------- 图书主页: ...
This introduction to computational geometry focuses on algorithms. Motivation is provided from the application areas as all techniques are related to particular applications in robotics, graphics, CAD...
自适应滤波算法与实现(第四版),英文版,Paulo S. R. Diniz,2013
"Machine Learning: Algorithms and Applications" 2016 | ISBN-10: 1498705383 | 226 pages | EPUB | 6 MB Machine learning, one of the top emerging sciences, has an extremely broad range of applications....
《Computer Vision:Algorithms and Applications》by Richard Szeliski, 2010
Computational Geometry: Algorithms and Applications, 3rd ed (2008), De Berg et al. Authors: Mark de Berg, Otfried Cheong, Marc van Kreveld, Mark Overmars Publisher: Springer; 3rd edition (April 16, ...
Computer Vision Algorithms and Applications
C/C++实现的内存管理算法教材,CHM格式
researchers in computer vision have been developing in parallel,mathematical techniques
this dissertation develops energy-ecient algorithms that employ certain kinds of cooperation among terminals, and illustrates how one might incorporate these algorithms into various network ...
作者:Rick Parent, 计算机动画方面的书籍,对3D动画编程人员来说是不可多得的好书,附带网站源码。
Approximate Dynamic Programming:Algorithms
Richard Szeliski著《计算机视觉:算法与应用》英文原版pdf全文。不建议英文不好的同学下载。
介绍网络路由算法,协议,架构 Network Routing: Algorithms Protocols and Architectures