package src.main.java.com.search; import java.util.Arrays; /** * Exponential search (also called doubling search or galloping search or Struzik search) is an algorithm which finds * the position of a target value within an array. It works by determining a range that the search key resides in and * performing a binary search within that range *
* Worst-case performance O(n)
* Best-case performance O(1)
* Average performance O(Log n)
* Worst-case space complexity O(Log n)
*/
public class ExponentialSearch {
/**
* @param array is an array where the element should be found
* @param key is an element which should be found
* @param