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
Rate this item
(3 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 16933 times
More in this category: « Matlab vectors - arrays

Κερδίστε Χρήματα Από Τις Αγορές Σας!

eBay Worldwide

eBay Worldwide

Καταχώρηση συνεργαζόμενης επιχείρησης στο

Fatal error: require_once(): Failed opening required '/home/softmast/' (include_path='.:/usr/share/php:/usr/share/pear') in /home/softmast/ on line 250