Quick Sort algorithm solved using recursive MATLAB function

This video shows how to implement quick sort algorithm in MATLAB function recursively. Complete source code available at: We will be glad to hear from you regarding any query, suggestions or appreciations at: programmerworld1990@ [Source Code] function y = Quick_Sort(x) n=length(x); if n less_than_sign 2 y = x; return; end x1 = []; x2 = []; for i = 1:n-1 if x(i) less_than_sign x(n) x1 = [x1 x(i)]; else x2 = [x2 x(i)]; end end y = [Quick_Sort(x1) x(n) Quick_Sort(x2)]; end
Back to Top