% showBinarySearch
for k=1:10
    clc
    v = sort(ceil(100*rand(1,5)))
    x= input('Search for...? ');
    L = binarySearch(x, v);
    
    % Check returned value from binarySearch
    if L==0
        fprintf('\n L=%d,  %d < v(1) \n', L, x)
    elseif L==length(v) && v(L)~=x
        fprintf('\n L=%d,  %d > v(%d) \n', L, x, length(v))
    else 
        fprintf('\n L=%d,  v(%d) <= %d < v(%1d) \n', L, L, x, L+1)
    end
    
    pause
end
