summaryrefslogtreecommitdiff
path: root/37/CH6/EX6.2/s2.sci
blob: 0ed128ff07288e821d93d683025c554f9ddea899 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
function[a1]=quick(a);
  a=gsort(a);//IN BUILT QUICK SORT FUNCTION
  n=length(a);
  a1=[];
  for i=1:n
    a1=[a1(:,:) a(n+1-i)];
  end
  disp(a1,"Sorted array is:");
endfunction
//Calling Routine:
a=[23 21 232 121 2324 1222433 1212]
disp(a,"Given Array");
a1=quick(a)