JavaAlgorithms/Searches/SearchAlgorithm.java

18 lines
445 B
Java
Raw Normal View History

2018-11-14 01:15:47 +08:00
package Searches;
/**
* The common interface of most searching algorithms
*
* @author Podshivalov Nikita (https://github.com/nikitap492)
2020-10-24 18:23:28 +08:00
*/
public interface SearchAlgorithm {
2020-10-24 18:23:28 +08:00
/**
* @param key is an element which should be found
* @param array is an array where the element should be found
* @param <T> Comparable type
* @return first found index of the element
*/
<T extends Comparable<T>> int find(T array[], T key);
}