Code covered by the BSD License  

Highlights from
Merge sort algorithm

Merge sort algorithm

by

 

This function executes what I think is the merge sort algorithm invented by John von Neumann in 1945

fusionedtest.m
clear
clc

cicles = input('insert number of comparisons -> ');

c=0; q=0;
tic

while c < cicles
    
    lol = randi(1000,1,1000);
    slol = sort(lol);
    flol = fusioned(lol);
    success = isequal(slol,flol);
    
    c = c + 1;
    q = q + success;
    
end

isEverythingEqual = (c == q)
time = toc

Contact us