本文介绍了在对数时间内找到未排序数组中的最小值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有一种算法可以找到对数时间(O(logn))中未排序数组的最小值?还是只能在线性时间内进行?我不想平行.
Is there an algorithmic approach to find the minimum of an unsorted array in logarithmic time ( O(logn) )? Or is it only possible in linear time? I don't want to go parallel.
谢谢
迈克尔
推荐答案如果列表未排序,则搜索必须至少是线性的.您必须至少查看每个项目一次,因为您没有看过的任何东西都可能比您已经看过的东西少.
If the list is unsorted, your search has to be at least linear. You must look at each item at least once, because anything you haven't looked at might be less than what you've already seen.
更多推荐
在对数时间内找到未排序数组中的最小值
发布评论