在java中的有序列表中进行二进制搜索 [英] Binary search in an ordered list in java

查看:141
本文介绍了在java中的有序列表中进行二进制搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种在java中实现代码的方法,其工作方式与在有序ArrayList中的二进制搜索相同,但是对于有序List
谢谢

Im looking for a way to implement a code in java that works the same way as a binary search in an ordered ArrayList but for an ordered List Thanks

推荐答案

对于 ArrayList List ,鉴于他们都是有序的。

The algorithm should be the same for both an ArrayList and a List, given they are both ordered.

这篇关于在java中的有序列表中进行二进制搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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