
Patrick B. answered 03/28/21
Math and computer tutor/teacher
looks like bubble sort
which is O(n^2)
Jonathan S.
asked 03/23/21function array question_1 (array, array_length)
temp = zeros (1,'uint16');
for amount = 1 : (array_length-1)
for position = 1 : (array_length-1)
if array (position) <array (position+1)
temp = array (position);
array (position) = array (position+1);
array (position+1) = temp;
end
end
end
end
Patrick B. answered 03/28/21
Math and computer tutor/teacher
looks like bubble sort
which is O(n^2)
Get a free answer to a quick problem.
Most questions answered within 4 hours.
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.