public class Search extends Object
Constructor and Description |
---|
Search() |
Modifier and Type | Method and Description |
---|---|
static int[] |
findTopN(double[] values,
int n)
Returns the indexes of the biggest n elements of the values array.
|
static int |
getIndex(int[] array,
int value)
Gets efficiently the userIndex of an element in an array of integers
|
public static int getIndex(int[] array, int value)
array
- Array of integers sorted from lowest to highestvalue
- Value which calculates the positionpublic static int[] findTopN(double[] values, int n)
values
- Array to search its top n elementsn
- Number of elements to obtainCopyright © 2020. All rights reserved.