From f35ea80659b6a49d1bb2ce1d7d002583f3f40947 Mon Sep 17 00:00:00 2001 From: prashantsinalkar Date: Tue, 10 Oct 2017 12:38:01 +0530 Subject: updated the code --- 37/CH7/EX7.2/s2.sci | 41 ++++++++++++++++------------------------- 1 file changed, 16 insertions(+), 25 deletions(-) (limited to '37/CH7/EX7.2/s2.sci') diff --git a/37/CH7/EX7.2/s2.sci b/37/CH7/EX7.2/s2.sci index a8638db30..3406b80cf 100755 --- a/37/CH7/EX7.2/s2.sci +++ b/37/CH7/EX7.2/s2.sci @@ -1,25 +1,16 @@ -function[]=sortedsearch(a,n,ele) - if(a(1)>ele|a(n)ele) - break; - end - end - end - if(j==0) - disp("%d NOT FOUND",ele); - end - end -endfunction -//Calling Routine: -a=[2 22 23 33 121 222 233]//a should be sorted -disp(a,"Given array"); -search(a,7,23) +function[]=sortedsearch(a,n,ele) + if(a(1)>ele|a(n)ele) + break; + end + end + end + if(j==0) + disp("%d NOT FOUND",ele); + end + end +endfunction +//Calling Routine: +a=[2 22 23 33 121 222 233]//a should be sorted +disp(a,"Given array"); +sortedsearch(a,7,23) + \ No newline at end of file -- cgit