Finding the block where element is present ( if it is present )
$ prev = 0 ; while ( $ arr [ min ( $ step , $ n ) - 1 ] < $ x ) { $ prev = $ step ; $ step += sqrt ( $ n ) ; if ( $ prev >= $ n ) return -1 ; }