There is an sorted array (ascending). The array may have positive numbers, negative numbers, or 0. It is required to obtain the minimum absolute value of the elements in the array, the sequential comparison method cannot be used (the complexity must be less than O (n), and can be implemented in any language, for example, array {-20,-13,-4, 6, 77,200 }, the smallest absolute value is-4. The basic idea of Algorithm Implementation is to find the negative and positive number demarcation points. If it happens to be 0, it will be it. If it is a positive number, it will be compared with the absolute value of the negative number adjacent to the left side. If it is a negative number, compare the absolute value with the positive number on the right. Consider that the array only has positive or negative numbers. Based on this idea, I implemented an algorithm in Java. Everyone has better implementation methods. Please refer to [java] public class MinAbsoluteValue {private static int getMinAbsoluteValue (int [] source) {int index = 0; int result = 0; int startIndex = 0; int endIndex = source. length-1; // calculate the negative number and positive number of demarcation points while (true) {index = startIndex + (endIndex-startIndex)/2; result = source [index]; if (result = 0) {return 0;} else if (result> 0) {if (index = 0) {break ;} if (source [index-1]> 0) endIndex = index-1; else if (source [index-1] = 0) return 0; else break ;} else {if (index = endIndex) break; if (source [index + 1] <0) startIndex = index + 1; else if (source [index + 1] = 0) return 0; else break; }}// calculate the minimum number of absolute values based on the demarcation point if (source [index]> 0) {if (index = 0 | source [index] <Math. abs (source [index-1]) result = source [index]; else result = source [index-1];} else {if (index = source. length-1 | Math. abs (source [index]) <source [index + 1]) result = source [index]; else result = source [index + 1];} return result ;} public static void main (String [] args) throws Exception {int [] arr1 = new int [] {-23,-22,-3, 120}; int [] arr2 = new int [] {-23,-22,-12,-6,-4 }; int [] arr3 = new int [] {66,333,}; int value = getMinAbsoluteValue (arr1); System. out. println (value); value = getMinAbsoluteValue (arr2); System. out. println (value); value = getMinAbsoluteValue (arr3); System. out. println (value );}}