Skip to content
Είστε εδώ: Home
Thursday, 22 November 2012 09:33

Matlab code for Bubble Sort Featured

Written by 
  • font size decrease font size decrease font size increase font size increase font size
  • Print
  • Email
  • My Great Web page
  • Be the first to comment!
Rate this item
(2 votes)


function S = bubblesort(A)
% Assume A row/column; Copy A to S
S = A;
N = length(S);
for lastcompare=N-1:-1:1
for i=1:lastcompare
   if S(i)>S(i+1)
     tmp = S(i);
     S(i) = S(i+1);
     S(i+1) = tmp;


Read 13357 times
More in this category: « Matlab vectors - arrays

Leave a comment

Make sure you enter the (*) required information where indicated. HTML code is not allowed.



Joomla 3.0 Extensions





Check Page Rank of your Web site pages instantly:

This page rank checking tool is powered by service