@@ -264,4 +264,61 @@ export const interpolationSearchMetaData : Algorithms = {
264264
265265// ----------------------------------- End ----------------------------------------------//
266266
267+ // -------------------------------- Exponential Search ------------------------------------//
268+
269+ const exponentialSearchData = {
270+ defination :`Exponential search allows for searching through a sorted, unbounded list for a specified input value
271+ (the search "key"). The algorithm consists of two stages. The first stage determines a range in which the search
272+ key would reside if it were in the list. In the second stage, a binary search is performed on this range. In the first stage,
273+ assuming that the list is sorted in ascending order, the algorithm looks for the first exponent, j, where the value 2^j is greater
274+ than the search key. This value, 2^j becomes the upper bound for the binary search with the previous power of 2, 2^(j - 1), being the
275+ lower bound for the binary search` ,
276+ flowChart : 'assets/ds-image/DSA-404.webp' ,
277+ explainImage : 'assets/ds-image/DSA-404.webp' ,
278+ properties : [
279+ `Finding the range in which the key could sit` ,
280+ `Applying binary search in this range` ,
281+ `Exponential search algorithm (also called doubling search, galloping search, Struzik search) is a search algorithm,
282+ created by Jon Bentley and Andrew Chi-Chih Yao in 1976, for searching sorted, unbounded/infinite lists`
283+ ] ,
284+ workingProcedure : [
285+ `Start with value i=1` ,
286+ `Check for a condition i < n and Array[i]<=key, where n is the number of items in the array and key is the element being sought` ,
287+ `Increment value of I in powers of 2, that is, i=i*2` ,
288+ `Keep on incrementing the value of 'i' until the condition is met` ,
289+ `Apply binary on the range i/2 to the end of Array - binarySearch(Array, i/2, min(i,n-1))`
290+ ] ,
291+ applications : [
292+ `Exponential Binary Search is useful for unbounded searches where size of array is infinite` ,
293+ `It works better than Binary Search for bounded arrays when the element to be searched is closer to the beginning of the array.`
294+ ] ,
295+ advantages : [
296+ `Exponential Binary Search is useful for unbounded searches where size of array is infinite` ,
297+ ] ,
298+ disadvantages : [
299+ `The list should be sorted to perform the exponential search, if the list is unsorted, it will give wrong results`
300+ ] ,
301+ performance : [
302+ `Worst case time complexity: O(log i) where i is the index of the element being searched` ,
303+ `Average case time complexity: O(log i)` ,
304+ `Best case time complexity: O(1)` ,
305+ `Space complexity: O(1)`
306+ ]
307+
308+ } ;
309+
310+ export const exponentialSearchMetaData : Algorithms = {
311+ defination : Helper . setHeader ( exponentialSearchData . defination ) ,
312+ properties : Helper . setListwithTitleHtml ( 'Properties of Exponential Search' , exponentialSearchData . properties ) ,
313+ explainImage : Helper . setExampleImage ( 'Exponential Search Image' , exponentialSearchData . explainImage ) ,
314+ flowChart : Helper . setExampleImage ( 'Flowchart of Exponential Search' , exponentialSearchData . flowChart ) ,
315+ advantage : Helper . setListwithTitleHtml ( 'Advantages of Exponential Search' , exponentialSearchData . advantages ) ,
316+ disadvantage : Helper . setListwithTitleHtml ( 'Disadvantages of Exponential Search' , exponentialSearchData . disadvantages ) ,
317+ applications : Helper . setListwithTitleHtml ( 'Applications of Exponential Search' , exponentialSearchData . applications ) ,
318+ other : Helper . setListwithTitleHtml ( 'Performance of Exponential Search' , exponentialSearchData . performance ) ,
319+ workingProcedure : Helper . setListwithTitleHtml ( 'Follow the below steps to solve the problem' , exponentialSearchData . workingProcedure ) ,
320+ }
321+
322+ // ----------------------------------- End ----------------------------------------------//
323+
267324
0 commit comments