function SV = isort(V)

% Implementing insertion sort
% V is a vector of elements to sort
% SV is a sorted vector of elements  

for k = 2:N

    idx = move_left(V,k);
    V = slide(V,idx,k);

end

function idx = move_left(V,k)
% Find the index on the left 
% where the element should be moved

function V = slide(V,idx,k)
% Slide elements idx+1...k-1 to the right
% and move element k to idx 

