summaryrefslogtreecommitdiff
path: root/1034/CH7/EX7.3/7s3.sce
blob: df0e95f3ff5cd77c39c3c3171b95f8a4f2205dfe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
clear;
clc;
disp("Example 7.3");
funcprot(0);
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=[26 5 37 1 61 11 59 15 48 19]
disp(a,"Given Array");
a1=quick(a)