-3
请问任何机构都有java inplementation exponentail搜索?我无法找到关于该算法的任何有关如何实现它的想法?喜欢的东西:指数搜索?
* Signature method that must implement exponential search.
* @ Param searchArray integer array in ascending.
* @ Param x integer element to search for.
* @ Return integer containing the position in the array <CODE> searchArray <\ CODE>
* In case the element <CODE> x <\ CODE> be located in this otherwise
* <CODE> Returns NOT_FOUND </ CODE>
public int exponentialSearch (int [] searchArray, int x);
你的意思是对数搜索?由于数组是预分类的,因此可以在log(N)时间内搜索(请参阅@Makato答案)。也许沿着“对数”这一行被翻译成“指数”或某些类似的地方。 – user949300
目前还不清楚你在寻找什么。值x?这可以在线性时间完成。指数算法效率会低得多...... –