Driver code
public static void main ( String args [ ] ) { String arr [ ] = { " for " , " geeks " , " " , " " , " " , " " , " ide " , " practice " , " " , " " , " " , " quiz " } ; String x = " geeks " ; int n = x . length ( ) ; int index = sparseSearch ( arr , x , n ) ; if ( index != - 1 ) System . out . println ( x + " ▁ found ▁ at ▁ index ▁ " + index ) ; else System . out . println ( x + " ▁ not ▁ found " ) ; } }