2018-11-14 01:15:47 +08:00
|
|
|
package Searches;
|
2018-04-12 21:37:47 +08:00
|
|
|
|
|
|
|
/**
|
2019-05-09 19:32:54 +08:00
|
|
|
* The common interface of most searching algorithms
|
2018-04-12 21:37:47 +08:00
|
|
|
*
|
|
|
|
* @author Podshivalov Nikita (https://github.com/nikitap492)
|
|
|
|
**/
|
|
|
|
public interface SearchAlgorithm {
|
|
|
|
|
|
|
|
/**
|
2019-05-09 19:32:54 +08:00
|
|
|
* @param key is an element which should be found
|
2018-04-12 21:37:47 +08:00
|
|
|
* @param array is an array where the element should be found
|
2019-05-09 19:32:54 +08:00
|
|
|
* @param <T> Comparable type
|
2018-04-12 21:37:47 +08:00
|
|
|
* @return first found index of the element
|
|
|
|
*/
|
|
|
|
<T extends Comparable<T>> int find(T array[], T key);
|
|
|
|
|
|
|
|
}
|