Sorting Algorithms: Bubble Sort (MATLAB)

preview_player
Показать описание
This is an introduction and explanation on how to code the Bubble Sort Algorithm in Matlab.
Рекомендации по теме
Комментарии
Автор

might be my favourite channel on youtube

knwmr
Автор

nice are solving like competitive programming problem😂😅.

laxmangoliya
Автор

How does matlab 'know' when the array is fully sorted and the function can end? Wouldn't it iterate just once and leave it unsorted?

soeskebapyt
Автор

HELP! need to debug this:

clear
n = 8;
x = randperm(n)

for i=1:n-1
for j=n:-1:i+1
if x(j-1) < x(j)
swap( x(j-1), x(j) );
end
end
end

x

function swap( x, y)
% swap_bug(x, y)

temp = x;
x = y;
y = temp;

THANKS IN ADVANCE

thepredatorkostas
join shbcf.ru