高效的搜索和实施Java中的排序算法 [英] Efficient implementations of Searching & Sorting Algorithms in Java

查看:120
本文介绍了高效的搜索和实施Java中的排序算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于常见的搜索和排序算法的一组Java代码实现,没有人有很好的参考。

Does anyone have a good reference for a set of Java code implementations of common searching and sorting algorithms.

有很多方法可以给猫做皮毛(它很容易在网上找到各种算法的Java代码),但是这里列出了Java中最有效的方法来实现这些各种算法?

There are many ways to skin a cat (its easy to find Java code of various algos on the net), however is there a list of the most efficient ways in Java to implement these various algorithms?

例如, http:/ /www.algorithmist.com ,但是大多数实现都是在C / C ++中实现的。

There is for example the http://www.algorithmist.com but most implementations are in C/C++.

干杯!

推荐答案

我建议您查看Java标准库源代码本身。

I'd suggest looking at the Java Standard Library source code itself.

集合数组类具有二进制搜索和二进制排序实现,您可以研究这些实现。

The Collections and Arrays classes have binary search and binary sort implementations which you can study.

以下是来自openjdk的Collections.java的来源: http ://www.d ocjar.com/html/api/java/util/Collections.java.html

Here's the source for Collections.java from openjdk: http://www.docjar.com/html/api/java/util/Collections.java.html

这篇关于高效的搜索和实施Java中的排序算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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